git-diff 129 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945
  1. $ git diff > ./UPGRADE-NOTES/git-diff
  2. diff --cc .gitignore
  3. index c523952,a13d346..0000000
  4. --- a/.gitignore
  5. +++ b/.gitignore
  6. @@@ -26,16 -12,9 +12,15 @@@ public/img/avatar
  7. *.exe~
  8. /gogs
  9. profile/
  10. - __pycache__
  11. *.pem
  12. output*
  13. - config.codekit
  14. - .brackets.json
  15. - docker/fig.yml
  16. - docker/docker/Dockerfile
  17. - docker/docker/init_gogs.sh
  18. gogs.sublime-project
  19. gogs.sublime-workspace
  20. ++<<<<<<< HEAD
  21. +debian/gogs
  22. +debian/build
  23. +debian/files
  24. ++=======
  25. + /release
  26. + vendor
  27. ++>>>>>>> upstream/master
  28. diff --cc cmd/web.go
  29. index f80792c,5dad862..0000000
  30. --- a/cmd/web.go
  31. +++ b/cmd/web.go
  32. @@@ -184,71 -191,29 +191,83 @@@ func runWeb(ctx *cli.Context) error
  33. m := newMacaron()
  34. - reqSignIn := middleware.Toggle(&middleware.ToggleOptions{SignInRequire: true})
  35. - ignSignIn := middleware.Toggle(&middleware.ToggleOptions{SignInRequire: setting.Service.RequireSignInView})
  36. - ignSignInAndCsrf := middleware.Toggle(&middleware.ToggleOptions{DisableCsrf: true})
  37. - reqSignOut := middleware.Toggle(&middleware.ToggleOptions{SignOutRequire: true})
  38. + reqSignIn := context.Toggle(&context.ToggleOptions{SignInRequired: true})
  39. + ignSignIn := context.Toggle(&context.ToggleOptions{SignInRequired: setting.Service.RequireSignInView})
  40. + ignSignInAndCsrf := context.Toggle(&context.ToggleOptions{DisableCSRF: true})
  41. + reqSignOut := context.Toggle(&context.ToggleOptions{SignOutRequired: true})
  42. - bind := binding.Bind
  43. bindIgnErr := binding.BindIgnErr
  44. + // FIXME: not all routes need go through same middlewares.
  45. + // Especially some AJAX requests, we can reduce middleware number to improve performance.
  46. // Routers.
  47. m.Get("/", ignSignIn, routers.Home)
  48. ++<<<<<<< HEAD
  49. + m.Get("/explore", ignSignIn, routers.Explore)
  50. + m.Get("/help", ignSignIn, routers.Help)
  51. + m.Get("/about", ignSignIn, routers.About)
  52. + m.Get("/tos", ignSignIn, routers.Tos)
  53. + m.Get("/outages", ignSignIn, routers.Outages)
  54. + m.Combo("/install", routers.InstallInit).
  55. + Get(routers.Install).
  56. + Post(bindIgnErr(auth.InstallForm{}), routers.InstallPost)
  57. + m.Group("", func() {
  58. + m.Get("/pulls", user.Pulls)
  59. + m.Get("/issues", user.Issues)
  60. + }, reqSignIn)
  61. +
  62. + // API.
  63. + // FIXME: custom form error response.
  64. + m.Group("/api", func() {
  65. + m.Group("/v1", func() {
  66. + // Miscellaneous.
  67. + m.Post("/markdown", bindIgnErr(apiv1.MarkdownForm{}), v1.Markdown)
  68. + m.Post("/markdown/raw", v1.MarkdownRaw)
  69. +
  70. + // Users.
  71. + m.Group("/users", func() {
  72. + m.Get("/search", v1.SearchUsers)
  73. +
  74. + m.Group("/:username", func() {
  75. + m.Get("", v1.GetUserInfo)
  76. +
  77. + m.Group("/tokens", func() {
  78. + m.Combo("").Get(v1.ListAccessTokens).Post(bind(v1.CreateAccessTokenForm{}), v1.CreateAccessToken)
  79. + }, middleware.ApiReqBasicAuth())
  80. + })
  81. + })
  82. +
  83. + // Repositories.
  84. + m.Combo("/user/repos", middleware.ApiReqToken()).Get(v1.ListMyRepos).Post(bind(api.CreateRepoOption{}), v1.CreateRepo)
  85. + m.Post("/org/:org/repos", middleware.ApiReqToken(), bind(api.CreateRepoOption{}), v1.CreateOrgRepo)
  86. + m.Group("/repos", func() {
  87. + m.Get("/search", v1.SearchRepos)
  88. + m.Post("/migrate", bindIgnErr(auth.MigrateRepoForm{}), v1.MigrateRepo)
  89. +
  90. + m.Group("/:username/:reponame", func() {
  91. + m.Combo("/hooks").Get(v1.ListRepoHooks).Post(bind(api.CreateHookOption{}), v1.CreateRepoHook)
  92. + m.Patch("/hooks/:id:int", bind(api.EditHookOption{}), v1.EditRepoHook)
  93. + m.Get("/raw/*", middleware.RepoRef(), v1.GetRepoRawFile)
  94. + }, middleware.ApiRepoAssignment(), middleware.ApiReqToken())
  95. + })
  96. +
  97. + m.Any("/*", func(ctx *middleware.Context) {
  98. + ctx.HandleAPI(404, "Page not found")
  99. + })
  100. ++=======
  101. + m.Group("/explore", func() {
  102. + m.Get("", func(ctx *context.Context) {
  103. + ctx.Redirect(setting.AppSubUrl + "/explore/repos")
  104. ++>>>>>>> upstream/master
  105. })
  106. - })
  107. + m.Get("/repos", routers.ExploreRepos)
  108. + m.Get("/users", routers.ExploreUsers)
  109. + }, ignSignIn)
  110. + m.Combo("/install", routers.InstallInit).Get(routers.Install).
  111. + Post(bindIgnErr(auth.InstallForm{}), routers.InstallPost)
  112. + m.Get("/^:type(issues|pulls)$", reqSignIn, user.Issues)
  113. - // User.
  114. + // ***** START: User *****
  115. m.Group("/user", func() {
  116. m.Get("/login", user.SignIn)
  117. m.Post("/login", bindIgnErr(auth.SignInForm{}), user.SignInPost)
  118. diff --cc models/issue.go
  119. index 367205a,189b207..0000000
  120. --- a/models/issue.go
  121. +++ b/models/issue.go
  122. @@@ -50,39 -51,159 +51,169 @@@ type Issue struct
  123. RenderedContent string `xorm:"-"`
  124. Priority int
  125. NumComments int
  126. - Deadline time.Time
  127. - Created time.Time `xorm:"CREATED"`
  128. - Updated time.Time `xorm:"UPDATED"`
  129. +
  130. + Deadline time.Time `xorm:"-"`
  131. + DeadlineUnix int64
  132. + Created time.Time `xorm:"-"`
  133. + CreatedUnix int64
  134. + Updated time.Time `xorm:"-"`
  135. + UpdatedUnix int64
  136. +
  137. + Attachments []*Attachment `xorm:"-"`
  138. + Comments []*Comment `xorm:"-"`
  139. }
  140. ++<<<<<<< HEAD
  141. +func (i *Issue) GetPoster() (err error) {
  142. + i.Poster, err = GetUserById(i.PosterId)
  143. + if err == ErrUserNotExist {
  144. + i.Poster = &User{Name: "DeletedUser"}
  145. + return nil
  146. + }
  147. + return err
  148. ++=======
  149. + func (i *Issue) BeforeInsert() {
  150. + i.CreatedUnix = time.Now().UTC().Unix()
  151. + i.UpdatedUnix = i.CreatedUnix
  152. ++>>>>>>> upstream/master
  153. }
  154. - func (i *Issue) GetLabels() error {
  155. - if len(i.LabelIds) < 3 {
  156. - return nil
  157. + func (i *Issue) BeforeUpdate() {
  158. + i.UpdatedUnix = time.Now().UTC().Unix()
  159. + i.DeadlineUnix = i.Deadline.UTC().Unix()
  160. + }
  161. +
  162. + func (issue *Issue) loadAttributes(e Engine) (err error) {
  163. + issue.Repo, err = getRepositoryByID(e, issue.RepoID)
  164. + if err != nil {
  165. + return fmt.Errorf("getRepositoryByID: %v", err)
  166. }
  167. - strIds := strings.Split(strings.TrimSuffix(i.LabelIds[1:], "|"), "|$")
  168. - i.Labels = make([]*Label, 0, len(strIds))
  169. - for _, strId := range strIds {
  170. - id, _ := com.StrTo(strId).Int64()
  171. - if id > 0 {
  172. - l, err := GetLabelById(id)
  173. - if err != nil {
  174. - if err == ErrLabelNotExist {
  175. - continue
  176. - }
  177. - return err
  178. + return nil
  179. + }
  180. +
  181. + func (issue *Issue) LoadAttributes() (err error) {
  182. + return issue.loadAttributes(x)
  183. + }
  184. +
  185. + func (i *Issue) AfterSet(colName string, _ xorm.Cell) {
  186. + var err error
  187. + switch colName {
  188. + case "id":
  189. + i.Attachments, err = GetAttachmentsByIssueID(i.ID)
  190. + if err != nil {
  191. + log.Error(3, "GetAttachmentsByIssueID[%d]: %v", i.ID, err)
  192. + }
  193. +
  194. + i.Comments, err = GetCommentsByIssueID(i.ID)
  195. + if err != nil {
  196. + log.Error(3, "GetCommentsByIssueID[%d]: %v", i.ID, err)
  197. + }
  198. +
  199. + i.Labels, err = GetLabelsByIssueID(i.ID)
  200. + if err != nil {
  201. + log.Error(3, "GetLabelsByIssueID[%d]: %v", i.ID, err)
  202. + }
  203. +
  204. + case "poster_id":
  205. + i.Poster, err = GetUserByID(i.PosterID)
  206. + if err != nil {
  207. + if IsErrUserNotExist(err) {
  208. + i.PosterID = -1
  209. + i.Poster = NewFakeUser()
  210. + } else {
  211. + log.Error(3, "GetUserByID[%d]: %v", i.ID, err)
  212. }
  213. - i.Labels = append(i.Labels, l)
  214. + return
  215. + }
  216. +
  217. + case "milestone_id":
  218. + if i.MilestoneID == 0 {
  219. + return
  220. + }
  221. +
  222. + i.Milestone, err = GetMilestoneByID(i.MilestoneID)
  223. + if err != nil {
  224. + log.Error(3, "GetMilestoneById[%d]: %v", i.ID, err)
  225. + }
  226. +
  227. + case "assignee_id":
  228. + if i.AssigneeID == 0 {
  229. + return
  230. + }
  231. +
  232. + i.Assignee, err = GetUserByID(i.AssigneeID)
  233. + if err != nil {
  234. + log.Error(3, "GetUserByID[%d]: %v", i.ID, err)
  235. }
  236. +
  237. + case "deadline_unix":
  238. + i.Deadline = time.Unix(i.DeadlineUnix, 0).Local()
  239. + case "created_unix":
  240. + i.Created = time.Unix(i.CreatedUnix, 0).Local()
  241. + case "updated_unix":
  242. + i.Updated = time.Unix(i.UpdatedUnix, 0).Local()
  243. + }
  244. + }
  245. +
  246. + // HashTag returns unique hash tag for issue.
  247. + func (i *Issue) HashTag() string {
  248. + return "issue-" + com.ToStr(i.ID)
  249. + }
  250. +
  251. + // State returns string representation of issue status.
  252. + func (i *Issue) State() string {
  253. + if i.IsClosed {
  254. + return "closed"
  255. + }
  256. + return "open"
  257. + }
  258. +
  259. + func (issue *Issue) FullLink() string {
  260. + return fmt.Sprintf("%s/issues/%d", issue.Repo.FullLink(), issue.Index)
  261. + }
  262. +
  263. + // IsPoster returns true if given user by ID is the poster.
  264. + func (i *Issue) IsPoster(uid int64) bool {
  265. + return i.PosterID == uid
  266. + }
  267. +
  268. + func (i *Issue) hasLabel(e Engine, labelID int64) bool {
  269. + return hasIssueLabel(e, i.ID, labelID)
  270. + }
  271. +
  272. + // HasLabel returns true if issue has been labeled by given ID.
  273. + func (i *Issue) HasLabel(labelID int64) bool {
  274. + return i.hasLabel(x, labelID)
  275. + }
  276. +
  277. + func (i *Issue) addLabel(e *xorm.Session, label *Label) error {
  278. + return newIssueLabel(e, i, label)
  279. + }
  280. +
  281. + // AddLabel adds new label to issue by given ID.
  282. + func (i *Issue) AddLabel(label *Label) (err error) {
  283. + sess := x.NewSession()
  284. + defer sessionRelease(sess)
  285. + if err = sess.Begin(); err != nil {
  286. + return err
  287. + }
  288. +
  289. + if err = i.addLabel(sess, label); err != nil {
  290. + return err
  291. + }
  292. +
  293. + return sess.Commit()
  294. + }
  295. +
  296. + func (i *Issue) getLabels(e Engine) (err error) {
  297. + if len(i.Labels) > 0 {
  298. + return nil
  299. + }
  300. +
  301. + i.Labels, err = getLabelsByIssueID(e, i.ID)
  302. + if err != nil {
  303. + return fmt.Errorf("getLabelsByIssueID: %v", err)
  304. }
  305. return nil
  306. }
  307. diff --cc models/repo.go
  308. index 4a39e2d,f8782db..0000000
  309. --- a/models/repo.go
  310. +++ b/models/repo.go
  311. @@@ -253,24 -518,31 +518,36 @@@ func (repo *Repository) CloneLink() (c
  312. }
  313. var (
  314. ++<<<<<<< HEAD
  315. + illegalEquals = []string{"debug", "raw", "install", "api", "avatar", "user", "org", "help", "stars", "issues", "pulls", "commits", "repo", "template", "admin", "new", "about", "tos", "error", "outages", "DeletedUser" }
  316. + illegalSuffixs = []string{".git", ".keys"}
  317. ++=======
  318. + reservedNames = []string{"debug", "raw", "install", "api", "avatar", "user", "org", "help", "stars", "issues", "pulls", "commits", "repo", "template", "admin", "new", ".", ".."}
  319. + reservedPatterns = []string{"*.git", "*.keys", "*.wiki"}
  320. ++>>>>>>> upstream/master
  321. )
  322. - // IsLegalName returns false if name contains illegal characters.
  323. - func IsLegalName(repoName string) bool {
  324. - repoName = strings.ToLower(repoName)
  325. - for _, char := range illegalEquals {
  326. - if repoName == char {
  327. - return false
  328. + // IsUsableName checks if name is reserved or pattern of name is not allowed.
  329. + func IsUsableName(name string) error {
  330. + name = strings.TrimSpace(strings.ToLower(name))
  331. + if utf8.RuneCountInString(name) == 0 {
  332. + return ErrNameEmpty
  333. + }
  334. +
  335. + for i := range reservedNames {
  336. + if name == reservedNames[i] {
  337. + return ErrNameReserved{name}
  338. }
  339. }
  340. - for _, char := range illegalSuffixs {
  341. - if strings.HasSuffix(repoName, char) {
  342. - return false
  343. +
  344. + for _, pat := range reservedPatterns {
  345. + if pat[0] == '*' && strings.HasSuffix(name, pat[1:]) ||
  346. + (pat[len(pat)-1] == '*' && strings.HasPrefix(name, pat[:len(pat)-1])) {
  347. + return ErrNamePatternNotAllowed{pat}
  348. }
  349. }
  350. - return true
  351. +
  352. + return nil
  353. }
  354. // Mirror represents a mirror information of repository.
  355. @@@ -351,33 -711,75 +716,81 @@@ func MigrateRepository(u *User, opts Mi
  356. repo.NumWatches = 1
  357. }
  358. - repo.IsBare = false
  359. - if mirror {
  360. - if err = MirrorRepository(repo.Id, u.Name, repo.Name, repoPath, url); err != nil {
  361. - return repo, err
  362. + os.RemoveAll(repoPath)
  363. + if err = git.Clone(opts.RemoteAddr, repoPath, git.CloneRepoOptions{
  364. + Mirror: true,
  365. + Quiet: true,
  366. + Timeout: time.Duration(setting.Git.Timeout.Migrate) * time.Second,
  367. + }); err != nil {
  368. + return repo, fmt.Errorf("Clone: %v", err)
  369. + }
  370. +
  371. + // Check if repository is empty.
  372. + _, stderr, err := com.ExecCmdDir(repoPath, "git", "log", "-1")
  373. + if err != nil {
  374. + if strings.Contains(stderr, "fatal: bad default revision 'HEAD'") {
  375. + repo.IsBare = true
  376. + } else {
  377. + return repo, fmt.Errorf("check bare: %v - %s", err, stderr)
  378. + }
  379. + }
  380. +
  381. + if !repo.IsBare {
  382. + // Try to get HEAD branch and set it as default branch.
  383. + gitRepo, err := git.OpenRepository(repoPath)
  384. + if err != nil {
  385. + return repo, fmt.Errorf("OpenRepository: %v", err)
  386. + }
  387. + headBranch, err := gitRepo.GetHEADBranch()
  388. + if err != nil {
  389. + return repo, fmt.Errorf("GetHEADBranch: %v", err)
  390. + }
  391. + if headBranch != nil {
  392. + repo.DefaultBranch = headBranch.Name
  393. + }
  394. + }
  395. +
  396. + if opts.IsMirror {
  397. + if _, err = x.InsertOne(&Mirror{
  398. + RepoID: repo.ID,
  399. + Interval: 24,
  400. + EnablePrune: true,
  401. + NextUpdate: time.Now().Add(24 * time.Hour),
  402. + }); err != nil {
  403. + return repo, fmt.Errorf("InsertOne: %v", err)
  404. }
  405. +
  406. repo.IsMirror = true
  407. return repo, UpdateRepository(repo, false)
  408. - } else {
  409. - os.RemoveAll(repoPath)
  410. }
  411. - // FIXME: this command could for both migrate and mirror
  412. - _, stderr, err := process.ExecTimeout(10*time.Minute,
  413. - fmt.Sprintf("MigrateRepository: %s", repoPath),
  414. - "git", "clone", "--mirror", "--bare", url, repoPath)
  415. + return CleanUpMigrateInfo(repo, repoPath)
  416. + }
  417. +
  418. + // Finish migrating repository with things that don't need to be done for mirrors.
  419. + func CleanUpMigrateInfo(repo *Repository, repoPath string) (*Repository, error) {
  420. + if err := createUpdateHook(repoPath); err != nil {
  421. + return repo, fmt.Errorf("createUpdateHook: %v", err)
  422. + }
  423. +
  424. + // Clean up mirror info which prevents "push --all".
  425. + // This also removes possible user credentials.
  426. + configPath := repo.GitConfigPath()
  427. + cfg, err := ini.Load(configPath)
  428. if err != nil {
  429. - return repo, fmt.Errorf("git clone --mirror --bare: %v", stderr)
  430. - } else if err = createUpdateHook(repoPath); err != nil {
  431. - return repo, fmt.Errorf("create update hook: %v", err)
  432. + return repo, fmt.Errorf("open config file: %v", err)
  433. + }
  434. + cfg.DeleteSection("remote \"origin\"")
  435. + if err = cfg.SaveToIndent(configPath, "\t"); err != nil {
  436. + return repo, fmt.Errorf("save config file: %v", err)
  437. }
  438. + // Default to 'master' branch if it exists
  439. + gitrepo, err := git.OpenRepository(repoPath)
  440. + if gitrepo.IsBranchExist("master") {
  441. + repo.DefaultBranch = "master"
  442. + }
  443. +
  444. return repo, UpdateRepository(repo, false)
  445. }
  446. diff --cc models/user.go
  447. index cfa14f8,e8e79f2..0000000
  448. --- a/models/user.go
  449. +++ b/models/user.go
  450. @@@ -54,9 -55,8 +55,14 @@@ type User struct
  451. LowerName string `xorm:"UNIQUE NOT NULL"`
  452. Name string `xorm:"UNIQUE NOT NULL"`
  453. FullName string
  454. ++<<<<<<< HEAD
  455. + // Email is the primary email address (to be used for communication).
  456. + Email string `xorm:"UNIQUE(s) NOT NULL"`
  457. + HideEmail bool
  458. ++=======
  459. + // Email is the primary email address (to be used for communication)
  460. + Email string `xorm:"NOT NULL"`
  461. ++>>>>>>> upstream/master
  462. Passwd string `xorm:"NOT NULL"`
  463. LoginType LoginType
  464. LoginSource int64 `xorm:"NOT NULL DEFAULT 0"`
  465. diff --cc modules/auth/user_form.go
  466. index be74ef0,57451d9..0000000
  467. --- a/modules/auth/user_form.go
  468. +++ b/modules/auth/user_form.go
  469. @@@ -77,13 -88,12 +88,22 @@@ func (f *SignInForm) Validate(ctx *maca
  470. // \/ \/ \/ \/ \/
  471. type UpdateProfileForm struct {
  472. ++<<<<<<< HEAD
  473. + UserName string `form:"uname" binding:"Required;MaxSize(35)"`
  474. + FullName string `form:"fullname" binding:"MaxSize(100)"`
  475. + Email string `form:"email" binding:"Required;Email;MaxSize(50)"`
  476. + HideEmail bool `form:"hideemail"`
  477. + Website string `form:"website" binding:"Url;MaxSize(100)"`
  478. + Location string `form:"location" binding:"MaxSize(50)"`
  479. + Avatar string `form:"avatar" binding:"Required;Email;MaxSize(50)"`
  480. ++=======
  481. + Name string `binding:"OmitEmpty;MaxSize(35)"`
  482. + FullName string `binding:"MaxSize(100)"`
  483. + Email string `binding:"Required;Email;MaxSize(254)"`
  484. + Website string `binding:"Url;MaxSize(100)"`
  485. + Location string `binding:"MaxSize(50)"`
  486. + Gravatar string `binding:"OmitEmpty;Email;MaxSize(254)"`
  487. ++>>>>>>> upstream/master
  488. }
  489. func (f *UpdateProfileForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
  490. diff --cc modules/mailer/mailer.go
  491. index d031ac1,80a6926..0000000
  492. --- a/modules/mailer/mailer.go
  493. +++ b/modules/mailer/mailer.go
  494. @@@ -7,9 -7,8 +7,12 @@@ package maile
  495. import (
  496. "crypto/tls"
  497. "fmt"
  498. ++<<<<<<< HEAD
  499. + "time"
  500. ++=======
  501. + "io"
  502. ++>>>>>>> upstream/master
  503. "net"
  504. - "net/mail"
  505. "net/smtp"
  506. "os"
  507. "strings"
  508. @@@ -19,63 -22,75 +26,87 @@@
  509. )
  510. type Message struct {
  511. - To []string
  512. - From string
  513. - Subject string
  514. - Body string
  515. - Type string
  516. - Massive bool
  517. - Info string
  518. + Info string // Message information for log purpose.
  519. + *gomail.Message
  520. }
  521. - // create mail content
  522. - func (m Message) Content() string {
  523. - // set mail type
  524. - contentType := "text/plain; charset=UTF-8"
  525. - if m.Type == "html" {
  526. - contentType = "text/html; charset=UTF-8"
  527. + // NewMessageFrom creates new mail message object with custom From header.
  528. + func NewMessageFrom(to []string, from, subject, htmlBody string) *Message {
  529. + log.Trace("NewMessageFrom (htmlBody):\n%s", htmlBody)
  530. +
  531. + msg := gomail.NewMessage()
  532. + msg.SetHeader("From", from)
  533. + msg.SetHeader("To", to...)
  534. + msg.SetHeader("Subject", subject)
  535. + msg.SetDateHeader("Date", time.Now())
  536. +
  537. + body, err := html2text.FromString(htmlBody)
  538. + if err != nil {
  539. + log.Error(4, "html2text.FromString: %v", err)
  540. + msg.SetBody("text/html", htmlBody)
  541. + } else {
  542. + msg.SetBody("text/plain", body)
  543. + if setting.MailService.EnableHTMLAlternative {
  544. + msg.AddAlternative("text/html", htmlBody)
  545. + }
  546. }
  547. ++<<<<<<< HEAD
  548. + // get and format current time for email headers
  549. + date := time.Now().Format(time.RFC1123Z)
  550. +
  551. + // generate a message-id for the email
  552. + messageid := fmt.Sprintf("%v@%s", time.Now().UnixNano(), setting.Domain)
  553. +
  554. + // create mail content
  555. + 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
  556. + return content
  557. ++=======
  558. + return &Message{
  559. + Message: msg,
  560. + }
  561. ++>>>>>>> upstream/master
  562. }
  563. - var mailQueue chan *Message
  564. + // NewMessage creates new mail message object with default From header.
  565. + func NewMessage(to []string, subject, body string) *Message {
  566. + return NewMessageFrom(to, setting.MailService.From, subject, body)
  567. + }
  568. - func NewMailerContext() {
  569. - mailQueue = make(chan *Message, setting.Cfg.Section("mailer").Key("SEND_BUFFER_LEN").MustInt(10))
  570. - go processMailQueue()
  571. + type loginAuth struct {
  572. + username, password string
  573. }
  574. - func processMailQueue() {
  575. - for {
  576. - select {
  577. - case msg := <-mailQueue:
  578. - num, err := Send(msg)
  579. - tos := strings.Join(msg.To, "; ")
  580. - info := ""
  581. - if err != nil {
  582. - if len(msg.Info) > 0 {
  583. - info = ", info: " + msg.Info
  584. - }
  585. - log.Error(4, fmt.Sprintf("Async sent email %d succeed, not send emails: %s%s err: %s", num, tos, info, err))
  586. - } else {
  587. - log.Trace(fmt.Sprintf("Async sent email %d succeed, sent emails: %s%s", num, tos, info))
  588. - }
  589. + // SMTP AUTH LOGIN Auth Handler
  590. + func LoginAuth(username, password string) smtp.Auth {
  591. + return &loginAuth{username, password}
  592. + }
  593. +
  594. + func (a *loginAuth) Start(server *smtp.ServerInfo) (string, []byte, error) {
  595. + return "LOGIN", []byte{}, nil
  596. + }
  597. +
  598. + func (a *loginAuth) Next(fromServer []byte, more bool) ([]byte, error) {
  599. + if more {
  600. + switch string(fromServer) {
  601. + case "Username:":
  602. + return []byte(a.username), nil
  603. + case "Password:":
  604. + return []byte(a.password), nil
  605. + default:
  606. + return nil, fmt.Errorf("unknwon fromServer: %s", string(fromServer))
  607. }
  608. }
  609. + return nil, nil
  610. }
  611. - // sendMail allows mail with self-signed certificates.
  612. - func sendMail(settings *setting.Mailer, recipients []string, msgContent []byte) error {
  613. - host, port, err := net.SplitHostPort(settings.Host)
  614. + type Sender struct {
  615. + }
  616. +
  617. + func (s *Sender) Send(from string, to []string, msg io.WriterTo) error {
  618. + opts := setting.MailService
  619. +
  620. + host, port, err := net.SplitHostPort(opts.Host)
  621. if err != nil {
  622. return err
  623. }
  624. diff --cc routers/home.go
  625. index 71e821e,1696752..0000000
  626. --- a/routers/home.go
  627. +++ b/routers/home.go
  628. @@@ -17,13 -19,10 +19,17 @@@ import
  629. const (
  630. HOME base.TplName = "home"
  631. EXPLORE_REPOS base.TplName = "explore/repos"
  632. ++<<<<<<< HEAD
  633. + HELP base.TplName = "help"
  634. + ABOUT base.TplName = "about"
  635. + TOS base.TplName = "tos"
  636. + OUTAGES base.TplName = "outages"
  637. ++=======
  638. + EXPLORE_USERS base.TplName = "explore/users"
  639. ++>>>>>>> upstream/master
  640. )
  641. - func Home(ctx *middleware.Context) {
  642. + func Home(ctx *context.Context) {
  643. if ctx.IsSigned {
  644. if !ctx.User.IsActive && setting.Service.RegisterEmailConfirm {
  645. ctx.Data["Title"] = ctx.Tr("auth.active_your_account")
  646. @@@ -67,34 -98,89 +105,117 @@@ func RenderRepoSearch(ctx *context.Cont
  647. }
  648. ctx.Data["Repos"] = repos
  649. - ctx.HTML(200, EXPLORE_REPOS)
  650. + ctx.HTML(200, opts.TplName)
  651. + }
  652. +
  653. + func ExploreRepos(ctx *context.Context) {
  654. + ctx.Data["Title"] = ctx.Tr("explore")
  655. + ctx.Data["PageIsExplore"] = true
  656. + ctx.Data["PageIsExploreRepositories"] = true
  657. +
  658. + RenderRepoSearch(ctx, &RepoSearchOptions{
  659. + Counter: models.CountPublicRepositories,
  660. + Ranger: models.GetRecentUpdatedRepositories,
  661. + PageSize: setting.ExplorePagingNum,
  662. + OrderBy: "updated_unix DESC",
  663. + TplName: EXPLORE_REPOS,
  664. + })
  665. + }
  666. +
  667. + type UserSearchOptions struct {
  668. + Type models.UserType
  669. + Counter func() int64
  670. + Ranger func(int, int) ([]*models.User, error)
  671. + PageSize int
  672. + OrderBy string
  673. + TplName base.TplName
  674. + }
  675. +
  676. + func RenderUserSearch(ctx *context.Context, opts *UserSearchOptions) {
  677. + page := ctx.QueryInt("page")
  678. + if page <= 1 {
  679. + page = 1
  680. + }
  681. +
  682. + var (
  683. + users []*models.User
  684. + count int64
  685. + err error
  686. + )
  687. +
  688. + keyword := ctx.Query("q")
  689. + if len(keyword) == 0 {
  690. + users, err = opts.Ranger(page, opts.PageSize)
  691. + if err != nil {
  692. + ctx.Handle(500, "opts.Ranger", err)
  693. + return
  694. + }
  695. + count = opts.Counter()
  696. + } else {
  697. + users, count, err = models.SearchUserByName(&models.SearchUserOptions{
  698. + Keyword: keyword,
  699. + Type: opts.Type,
  700. + OrderBy: opts.OrderBy,
  701. + Page: page,
  702. + PageSize: opts.PageSize,
  703. + })
  704. + if err != nil {
  705. + ctx.Handle(500, "SearchUserByName", err)
  706. + return
  707. + }
  708. + }
  709. + ctx.Data["Keyword"] = keyword
  710. + ctx.Data["Total"] = count
  711. + ctx.Data["Page"] = paginater.New(int(count), opts.PageSize, page, 5)
  712. + ctx.Data["Users"] = users
  713. +
  714. + ctx.HTML(200, opts.TplName)
  715. + }
  716. +
  717. + func ExploreUsers(ctx *context.Context) {
  718. + ctx.Data["Title"] = ctx.Tr("explore")
  719. + ctx.Data["PageIsExplore"] = true
  720. + ctx.Data["PageIsExploreUsers"] = true
  721. +
  722. + RenderUserSearch(ctx, &UserSearchOptions{
  723. + Type: models.USER_TYPE_INDIVIDUAL,
  724. + Counter: models.CountUsers,
  725. + Ranger: models.Users,
  726. + PageSize: setting.ExplorePagingNum,
  727. + OrderBy: "updated_unix DESC",
  728. + TplName: EXPLORE_USERS,
  729. + })
  730. }
  731. ++<<<<<<< HEAD
  732. +func Help(ctx *middleware.Context) {
  733. + ctx.Data["Title"] = ctx.Tr("help")
  734. +
  735. + ctx.HTML(200, HELP)
  736. +}
  737. +
  738. +func About(ctx *middleware.Context) {
  739. + ctx.Data["Title"] = ctx.Tr("about")
  740. +
  741. + ctx.HTML(200, ABOUT)
  742. +}
  743. +
  744. +func Tos(ctx *middleware.Context) {
  745. + ctx.Data["Title"] = ctx.Tr("tos")
  746. +
  747. + ctx.HTML(200, TOS)
  748. +}
  749. +
  750. +func Outages(ctx *middleware.Context) {
  751. + ctx.Data["Title"] = ctx.Tr("outages")
  752. +
  753. + ctx.HTML(200, OUTAGES)
  754. +}
  755. +
  756. +func NotFound(ctx *middleware.Context) {
  757. ++=======
  758. + func NotFound(ctx *context.Context) {
  759. ++>>>>>>> upstream/master
  760. ctx.Data["Title"] = "Page Not Found"
  761. ctx.Handle(404, "home.NotFound", nil)
  762. }
  763. diff --cc routers/repo/issue.go
  764. index c4d3043,5252429..0000000
  765. --- a/routers/repo/issue.go
  766. +++ b/routers/repo/issue.go
  767. @@@ -383,48 -481,109 +481,117 @@@ func UploadIssueAttachment(ctx *context
  768. return
  769. }
  770. - // Get all collaborators.
  771. - ctx.Data["Collaborators"], err = ctx.Repo.Repository.GetCollaborators()
  772. + log.Trace("New attachment uploaded: %s", attach.UUID)
  773. + ctx.JSON(200, map[string]string{
  774. + "uuid": attach.UUID,
  775. + })
  776. + }
  777. +
  778. + func ViewIssue(ctx *context.Context) {
  779. + ctx.Data["RequireDropzone"] = true
  780. + renderAttachmentSettings(ctx)
  781. +
  782. + issue, err := models.GetIssueByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index"))
  783. if err != nil {
  784. - ctx.Handle(500, "issue.CreateIssue(GetCollaborators)", err)
  785. + if models.IsErrIssueNotExist(err) {
  786. + ctx.Handle(404, "GetIssueByIndex", err)
  787. + } else {
  788. + ctx.Handle(500, "GetIssueByIndex", err)
  789. + }
  790. return
  791. }
  792. + ctx.Data["Title"] = issue.Name
  793. - if ctx.IsSigned {
  794. - // Update issue-user.
  795. - if err = models.UpdateIssueUserPairByRead(ctx.User.Id, issue.Id); err != nil {
  796. - ctx.Handle(500, "issue.ViewIssue(UpdateIssueUserPairByRead): %v", err)
  797. + // Make sure type and URL matches.
  798. + if ctx.Params(":type") == "issues" && issue.IsPull {
  799. + ctx.Redirect(ctx.Repo.RepoLink + "/pulls/" + com.ToStr(issue.Index))
  800. + return
  801. + } else if ctx.Params(":type") == "pulls" && !issue.IsPull {
  802. + ctx.Redirect(ctx.Repo.RepoLink + "/issues/" + com.ToStr(issue.Index))
  803. + return
  804. + }
  805. +
  806. + if issue.IsPull {
  807. + MustAllowPulls(ctx)
  808. + if ctx.Written() {
  809. + return
  810. + }
  811. + ctx.Data["PageIsPullList"] = true
  812. +
  813. + if err = issue.GetPullRequest(); err != nil {
  814. + ctx.Handle(500, "GetPullRequest", err)
  815. + return
  816. + }
  817. +
  818. + ctx.Data["PageIsPullConversation"] = true
  819. + } else {
  820. + MustEnableIssues(ctx)
  821. + if ctx.Written() {
  822. return
  823. }
  824. + ctx.Data["PageIsIssueList"] = true
  825. }
  826. - // Get poster and Assignee.
  827. - if err = issue.GetPoster(); err != nil {
  828. - ctx.Handle(500, "issue.ViewIssue(GetPoster): %v", err)
  829. - return
  830. - } else if err = issue.GetAssignee(); err != nil {
  831. - ctx.Handle(500, "issue.ViewIssue(GetAssignee): %v", err)
  832. - return
  833. + issue.RenderedContent = string(markdown.Render([]byte(issue.Content), ctx.Repo.RepoLink,
  834. + ctx.Repo.Repository.ComposeMetas()))
  835. +
  836. + repo := ctx.Repo.Repository
  837. +
  838. + // Get more information if it's a pull request.
  839. + if issue.IsPull {
  840. + if issue.HasMerged {
  841. + ctx.Data["DisableStatusChange"] = issue.HasMerged
  842. + PrepareMergedViewPullInfo(ctx, issue)
  843. + } else {
  844. + PrepareViewPullInfo(ctx, issue)
  845. + }
  846. + if ctx.Written() {
  847. + return
  848. + }
  849. }
  850. - issue.RenderedContent = string(base.RenderMarkdown([]byte(issue.Content), ctx.Repo.RepoLink))
  851. - // Get comments.
  852. - comments, err := models.GetIssueComments(issue.Id)
  853. + // Metas.
  854. + // Check labels.
  855. + labelIDMark := make(map[int64]bool)
  856. + for i := range issue.Labels {
  857. + labelIDMark[issue.Labels[i].ID] = true
  858. + }
  859. + labels, err := models.GetLabelsByRepoID(repo.ID)
  860. if err != nil {
  861. - ctx.Handle(500, "issue.ViewIssue(GetIssueComments): %v", err)
  862. + ctx.Handle(500, "GetLabelsByRepoID: %v", err)
  863. return
  864. }
  865. + hasSelected := false
  866. + for i := range labels {
  867. + if labelIDMark[labels[i].ID] {
  868. + labels[i].IsChecked = true
  869. + hasSelected = true
  870. + }
  871. + }
  872. + ctx.Data["HasSelectedLabel"] = hasSelected
  873. + ctx.Data["Labels"] = labels
  874. ++<<<<<<< HEAD
  875. + // Get posters.
  876. + for i := range comments {
  877. + u, err := models.GetUserById(comments[i].PosterId)
  878. + if err != nil {
  879. + u = &models.User{Name: "DeletedUser"}
  880. ++=======
  881. + // Check milestone and assignee.
  882. + if ctx.Repo.IsWriter() {
  883. + RetrieveRepoMilestonesAndAssignees(ctx, repo)
  884. + if ctx.Written() {
  885. + return
  886. ++>>>>>>> upstream/master
  887. }
  888. - comments[i].Poster = u
  889. + }
  890. - if comments[i].Type == models.COMMENT_TYPE_COMMENT {
  891. - comments[i].Content = string(base.RenderMarkdown([]byte(comments[i].Content), ctx.Repo.RepoLink))
  892. + if ctx.IsSigned {
  893. + // Update issue-user.
  894. + if err = issue.ReadBy(ctx.User.Id); err != nil {
  895. + ctx.Handle(500, "ReadBy", err)
  896. + return
  897. }
  898. }
  899. diff --cc routers/repo/setting.go
  900. index d08c563,c5772dc..0000000
  901. --- a/routers/repo/setting.go
  902. +++ b/routers/repo/setting.go
  903. @@@ -210,137 -241,64 +241,93 @@@ func SettingsPost(ctx *context.Context
  904. }
  905. }
  906. - ctx.Flash.Success(ctx.Tr("repo.settings.add_collaborator_success"))
  907. - ctx.Redirect(setting.AppSubUrl + ctx.Req.URL.Path)
  908. - return
  909. - }
  910. + if err := models.DeleteRepository(ctx.Repo.Owner.Id, repo.ID); err != nil {
  911. + ctx.Handle(500, "DeleteRepository", err)
  912. + return
  913. + }
  914. + log.Trace("Repository deleted: %s/%s", ctx.Repo.Owner.Name, repo.Name)
  915. - // Delete collaborator.
  916. - remove := strings.ToLower(ctx.Query("remove"))
  917. - if len(remove) > 0 && remove != ctx.Repo.Owner.LowerName {
  918. - u, err := models.GetUserByName(remove)
  919. - if err != nil {
  920. - ctx.Handle(500, "GetUserByName", err)
  921. + ctx.Flash.Success(ctx.Tr("repo.settings.deletion_success"))
  922. + ctx.Redirect(ctx.Repo.Owner.DashboardLink())
  923. +
  924. + case "delete-wiki":
  925. + if !ctx.Repo.IsOwner() {
  926. + ctx.Error(404)
  927. return
  928. }
  929. - if err := ctx.Repo.Repository.DeleteCollaborator(u); err != nil {
  930. - ctx.Handle(500, "DeleteCollaborator", err)
  931. + if repo.Name != form.RepoName {
  932. + ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_repo_name"), SETTINGS_OPTIONS, nil)
  933. return
  934. }
  935. - ctx.Flash.Success(ctx.Tr("repo.settings.remove_collaborator_success"))
  936. - ctx.Redirect(ctx.Repo.RepoLink + "/settings/collaboration")
  937. - return
  938. - }
  939. -
  940. - users, err := ctx.Repo.Repository.GetCollaborators()
  941. - if err != nil {
  942. - ctx.Handle(500, "GetCollaborators", err)
  943. - return
  944. - }
  945. - ctx.Data["Collaborators"] = users
  946. - ctx.HTML(200, COLLABORATION)
  947. - }
  948. + if ctx.Repo.Owner.IsOrganization() {
  949. + if !ctx.Repo.Owner.IsOwnedBy(ctx.User.Id) {
  950. + ctx.Error(404)
  951. + return
  952. + }
  953. + }
  954. - func Webhooks(ctx *middleware.Context) {
  955. - ctx.Data["Title"] = ctx.Tr("repo.settings")
  956. - ctx.Data["PageIsSettingsHooks"] = true
  957. + repo.DeleteWiki()
  958. + log.Trace("Repository wiki deleted: %s/%s", ctx.Repo.Owner.Name, repo.Name)
  959. - // Delete web hook.
  960. - remove := com.StrTo(ctx.Query("remove")).MustInt64()
  961. - if remove > 0 {
  962. - if err := models.DeleteWebhook(remove); err != nil {
  963. - ctx.Handle(500, "DeleteWebhook", err)
  964. + repo.EnableWiki = false
  965. + if err := models.UpdateRepository(repo, false); err != nil {
  966. + ctx.Handle(500, "UpdateRepository", err)
  967. return
  968. }
  969. - ctx.Flash.Success(ctx.Tr("repo.settings.remove_hook_success"))
  970. - ctx.Redirect(ctx.Repo.RepoLink + "/settings/hooks")
  971. - return
  972. - }
  973. - ws, err := models.GetWebhooksByRepoId(ctx.Repo.Repository.Id)
  974. - if err != nil {
  975. - ctx.Handle(500, "GetWebhooksByRepoId", err)
  976. - return
  977. + ctx.Flash.Success(ctx.Tr("repo.settings.wiki_deletion_success"))
  978. + ctx.Redirect(ctx.Repo.RepoLink + "/settings")
  979. }
  980. ++<<<<<<< HEAD
  981. +
  982. + ctx.Data["Webhooks"] = ws
  983. + ctx.HTML(200, HOOKS)
  984. +}
  985. +
  986. ++=======
  987. + }
  988. ++>>>>>>> upstream/master
  989. - func WebHooksNew(ctx *middleware.Context) {
  990. + func Collaboration(ctx *context.Context) {
  991. ctx.Data["Title"] = ctx.Tr("repo.settings")
  992. ++<<<<<<< HEAD
  993. + ctx.Data["PageIsSettingsHooks"] = true
  994. + ctx.Data["PageIsSettingsHooksNew"] = true
  995. + ctx.Data["Webhook"] = models.Webhook{HookEvent: &models.HookEvent{}}
  996. + ctx.Data["HookType"] = "Gogs"
  997. + orCtx, err := getOrgRepoCtx(ctx)
  998. + if err != nil {
  999. + ctx.Handle(500, "WebHooksNew(getOrgRepoCtx)", err)
  1000. + return
  1001. + }
  1002. +
  1003. + ctx.HTML(200, orCtx.NewTemplate)
  1004. +}
  1005. +
  1006. +func WebHooksNewPost(ctx *middleware.Context, form auth.NewWebhookForm) {
  1007. + ctx.Data["Title"] = ctx.Tr("repo.settings")
  1008. + ctx.Data["PageIsSettingsHooks"] = true
  1009. + ctx.Data["PageIsSettingsHooksNew"] = true
  1010. + ctx.Data["Webhook"] = models.Webhook{HookEvent: &models.HookEvent{}}
  1011. ++=======
  1012. + ctx.Data["PageIsSettingsCollaboration"] = true
  1013. ++>>>>>>> upstream/master
  1014. - orCtx, err := getOrgRepoCtx(ctx)
  1015. + users, err := ctx.Repo.Repository.GetCollaborators()
  1016. if err != nil {
  1017. - ctx.Handle(500, "WebHooksNewPost(getOrgRepoCtx)", err)
  1018. - return
  1019. - }
  1020. -
  1021. - if ctx.HasError() {
  1022. - ctx.HTML(200, orCtx.NewTemplate)
  1023. - return
  1024. - }
  1025. -
  1026. - // FIXME: code too old here, sync with APIs
  1027. - ct := models.JSON
  1028. - if form.ContentType == "2" {
  1029. - ct = models.FORM
  1030. - }
  1031. -
  1032. - w := &models.Webhook{
  1033. - RepoId: orCtx.RepoId,
  1034. - Url: form.PayloadUrl,
  1035. - ContentType: ct,
  1036. - Secret: form.Secret,
  1037. - HookEvent: &models.HookEvent{
  1038. - PushOnly: form.PushOnly,
  1039. - },
  1040. - IsActive: form.Active,
  1041. - HookTaskType: models.GOGS,
  1042. - Meta: "",
  1043. - OrgId: orCtx.OrgId,
  1044. - }
  1045. -
  1046. - if err := w.UpdateEvent(); err != nil {
  1047. - ctx.Handle(500, "UpdateEvent", err)
  1048. - return
  1049. - } else if err := models.CreateWebhook(w); err != nil {
  1050. - ctx.Handle(500, "CreateWebhook", err)
  1051. + ctx.Handle(500, "GetCollaborators", err)
  1052. return
  1053. }
  1054. + ctx.Data["Collaborators"] = users
  1055. - ctx.Flash.Success(ctx.Tr("repo.settings.add_hook_success"))
  1056. - ctx.Redirect(orCtx.Link + "/settings/hooks")
  1057. + ctx.HTML(200, COLLABORATION)
  1058. }
  1059. - func WebHooksEdit(ctx *middleware.Context) {
  1060. - ctx.Data["Title"] = ctx.Tr("repo.settings")
  1061. - ctx.Data["PageIsSettingsHooks"] = true
  1062. - ctx.Data["PageIsSettingsHooksEdit"] = true
  1063. -
  1064. - hookId := com.StrTo(ctx.Params(":id")).MustInt64()
  1065. - if hookId == 0 {
  1066. - ctx.Handle(404, "setting.WebHooksEdit", nil)
  1067. + func CollaborationPost(ctx *context.Context) {
  1068. + name := strings.ToLower(ctx.Query("collaborator"))
  1069. + if len(name) == 0 || ctx.Repo.Owner.LowerName == name {
  1070. + ctx.Redirect(setting.AppSubUrl + ctx.Req.URL.Path)
  1071. return
  1072. }
  1073. diff --cc routers/user/auth.go
  1074. index f5fcc85,df79ecb..0000000
  1075. --- a/routers/user/auth.go
  1076. +++ b/routers/user/auth.go
  1077. @@@ -5,9 -5,11 +5,14 @@@
  1078. package user
  1079. import (
  1080. + "fmt"
  1081. "net/url"
  1082. - "strings"
  1083. ++<<<<<<< HEAD
  1084. ++=======
  1085. + "github.com/go-macaron/captcha"
  1086. +
  1087. ++>>>>>>> upstream/master
  1088. "github.com/gogits/gogs/models"
  1089. "github.com/gogits/gogs/modules/auth"
  1090. "github.com/gogits/gogs/modules/base"
  1091. @@@ -185,14 -155,11 +158,15 @@@ func SignUp(ctx *context.Context)
  1092. ctx.HTML(200, SIGNUP)
  1093. }
  1094. ++<<<<<<< HEAD
  1095. +func SignUpPost(ctx *middleware.Context, form auth.RegisterForm) {
  1096. ++=======
  1097. + func SignUpPost(ctx *context.Context, cpt *captcha.Captcha, form auth.RegisterForm) {
  1098. ++>>>>>>> upstream/master
  1099. ctx.Data["Title"] = ctx.Tr("sign_up")
  1100. + ctx.Data["EnableCaptcha"] = setting.Service.EnableCaptcha
  1101. +
  1102. if setting.Service.DisableRegistration {
  1103. ctx.Error(403)
  1104. return
  1105. @@@ -224,11 -170,12 +177,15 @@@
  1106. return
  1107. }
  1108. - if ctx.HasError() {
  1109. - ctx.HTML(200, SIGNUP)
  1110. ++<<<<<<< HEAD
  1111. ++=======
  1112. + if setting.Service.EnableCaptcha && !cpt.VerifyReq(ctx.Req) {
  1113. + ctx.Data["Err_Captcha"] = true
  1114. + ctx.RenderWithErr(ctx.Tr("form.captcha_incorrect"), SIGNUP, &form)
  1115. return
  1116. }
  1117. ++>>>>>>> upstream/master
  1118. if form.Password != form.Retype {
  1119. ctx.Data["Err_Password"] = true
  1120. ctx.RenderWithErr(ctx.Tr("form.password_not_match"), SIGNUP, &form)
  1121. diff --cc templates/.VERSION
  1122. index eb5fd1e,545d782..0000000
  1123. --- a/templates/.VERSION
  1124. +++ b/templates/.VERSION
  1125. @@@ -1,1 -1,1 +1,5 @@@
  1126. -0.9.48.0722
  1127. ++<<<<<<< HEAD
  1128. +0.6.1.0325 Beta
  1129. ++=======
  1130. ++0.9.48.0722
  1131. ++>>>>>>> upstream/master
  1132. diff --cc templates/base/footer.tmpl
  1133. index 9242295,677d908..0000000
  1134. --- a/templates/base/footer.tmpl
  1135. +++ b/templates/base/footer.tmpl
  1136. @@@ -1,13 -1,54 +1,69 @@@
  1137. ++<<<<<<< HEAD
  1138. +<div class="wrapper-push"></div>
  1139. +</div>
  1140. +<footer id="footer">
  1141. + <div class="container footer-wrap">
  1142. + <div class="row">
  1143. + <div class="col-md-6">
  1144. + <p class="left"><a href="/about">About us</a></p>
  1145. + </div>
  1146. + </div>
  1147. + </div>
  1148. +</footer>
  1149. +</body>
  1150. ++=======
  1151. + {{/*
  1152. + <html>
  1153. + <body>
  1154. + <div>
  1155. + */}}
  1156. + </div>
  1157. + <footer>
  1158. + <div class="ui container">
  1159. + <div class="ui left">
  1160. + © 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>
  1161. + </div>
  1162. + <div class="ui right links">
  1163. + {{if .ShowFooterBranding}}
  1164. + <a target="_blank" href="https://github.com/gogits/gogs"><i class="fa fa-github-square"></i><span class="sr-only">GitHub</span></a>
  1165. + <a target="_blank" href="https://twitter.com/gogitservice"><i class="fa fa-twitter"></i><span class="sr-only">Twitter</span></a>
  1166. + <a target="_blank" href="http://weibo.com/gogschina"><i class="fa fa-weibo"></i><span class="sr-only">Sina Weibo</span></a>
  1167. + {{end}}
  1168. + <div class="ui language bottom floating slide up dropdown link item">
  1169. + <i class="world icon"></i>
  1170. + <div class="text">{{.LangName}}</div>
  1171. + <div class="menu">
  1172. + {{range .AllLangs}}
  1173. + <a class="item {{if eq $.Lang .Lang}}active selected{{end}}" href="{{if eq $.Lang .Lang}}#{{else}}{{$.Link}}?lang={{.Lang}}{{end}}">{{.Name}}</a>
  1174. + {{end}}
  1175. + </div>
  1176. + </div>
  1177. + <a target="_blank" href="http://gogs.io">{{.i18n.Tr "website"}}</a>
  1178. + {{if (or .ShowFooterVersion .PageIsAdmin)}}<span class="version">{{GoVer}}</span>{{end}}
  1179. + </div>
  1180. + </div>
  1181. + </footer>
  1182. + </body>
  1183. +
  1184. + <!-- Third-party libraries -->
  1185. + {{if .RequireHighlightJS}}
  1186. + <link rel="stylesheet" href="{{AppSubUrl}}/plugins/highlight-9.2.0/github.css">
  1187. + <script src="{{AppSubUrl}}/plugins/highlight-9.2.0/highlight.pack.js"></script>
  1188. + {{end}}
  1189. + {{if .RequireMinicolors}}
  1190. + <link rel="stylesheet" href="{{AppSubUrl}}/plugins/jquery.minicolors-2.2.3/jquery.minicolors.css">
  1191. + <script src="{{AppSubUrl}}/plugins/jquery.minicolors-2.2.3/jquery.minicolors.min.js"></script>
  1192. + {{end}}
  1193. + {{if .RequireDatetimepicker}}
  1194. + <link rel="stylesheet" href="{{AppSubUrl}}/plugins/jquery.datetimepicker-2.4.5/jquery.datetimepicker.css">
  1195. + <script src="{{AppSubUrl}}/plugins/jquery.datetimepicker-2.4.5/jquery.datetimepicker.js"></script>
  1196. + {{end}}
  1197. + {{if .RequireDropzone}}
  1198. + <link rel="stylesheet" href="{{AppSubUrl}}/plugins/dropzone-4.2.0/dropzone.css">
  1199. + <script src="{{AppSubUrl}}/plugins/dropzone-4.2.0/dropzone.js"></script>
  1200. + {{end}}
  1201. + <script src="{{AppSubUrl}}/js/libs/emojify-1.1.0.min.js"></script>
  1202. + <script src="{{AppSubUrl}}/js/libs/clipboard-1.5.9.min.js"></script>
  1203. +
  1204. ++>>>>>>> upstream/master
  1205. </html>
  1206. diff --cc templates/base/head.tmpl
  1207. index 99f9c7a,1fb91e9..0000000
  1208. --- a/templates/base/head.tmpl
  1209. +++ b/templates/base/head.tmpl
  1210. @@@ -13,18 -16,27 +16,32 @@@
  1211. <link rel="shortcut icon" href="{{AppSubUrl}}/img/favicon.png" />
  1212. ++<<<<<<< HEAD
  1213. + <script src="{{AppSubUrl}}/js/jquery-1.11.2.min.js"></script>
  1214. + <link rel="stylesheet" href="{{AppSubUrl}}/css/font-awesome.min.css">
  1215. ++=======
  1216. + <script src="{{AppSubUrl}}/js/jquery-1.11.3.min.js"></script>
  1217. + <script src="{{AppSubUrl}}/js/jquery.are-you-sure.js"></script>
  1218. + <link rel="stylesheet" href="{{AppSubUrl}}/assets/font-awesome-4.6.3/css/font-awesome.min.css">
  1219. + <link rel="stylesheet" href="{{AppSubUrl}}/assets/octicons-4.3.0/octicons.min.css">
  1220. +
  1221. + {{if .RequireSimpleMDE}}
  1222. + <link rel="stylesheet" href="{{AppSubUrl}}/plugins/simplemde-1.10.1/simplemde.min.css">
  1223. + <script src="{{AppSubUrl}}/plugins/simplemde-1.10.1/simplemde.min.js"></script>
  1224. + {{end}}
  1225. ++>>>>>>> upstream/master
  1226. <!-- Stylesheet -->
  1227. - <link rel="stylesheet" href="{{AppSubUrl}}/css/semantic.min.css">
  1228. - <link rel="stylesheet" href="{{AppSubUrl}}/css/gogs.min.css">
  1229. + <link rel="stylesheet" href="{{AppSubUrl}}/css/semantic-2.2.1.min.css">
  1230. + <link rel="stylesheet" href="{{AppSubUrl}}/css/gogs.css?v={{MD5 AppVer}}">
  1231. <!-- JavaScript -->
  1232. - <script src="{{AppSubUrl}}/js/semantic.min.js"></script>
  1233. - <script src="{{AppSubUrl}}/js/gogs.js"></script>
  1234. + <script src="{{AppSubUrl}}/js/semantic-2.2.1.min.js"></script>
  1235. + <script src="{{AppSubUrl}}/js/gogs.js?v={{MD5 AppVer}}"></script>
  1236. <title>{{if .Title}}{{.Title}} - {{end}}{{AppName}}</title>
  1237. +
  1238. + <meta name="theme-color" content="{{ThemeColorMetaTag}}">
  1239. </head>
  1240. <body>
  1241. <div class="full height">
  1242. diff --cc templates/home.tmpl
  1243. index f485da4,5bbc8d2..0000000
  1244. --- a/templates/home.tmpl
  1245. +++ b/templates/home.tmpl
  1246. @@@ -1,38 -1,280 +1,321 @@@
  1247. ++<<<<<<< HEAD
  1248. +{{template "ng/base/head" .}}
  1249. +{{template "ng/base/header" .}}
  1250. +<div id="promo-wrapper">
  1251. + <div class="container clear">
  1252. + <div id="promo-logo" class="left">
  1253. + <img src="{{AppSubUrl}}/img/notabug-lg.png" alt="logo" />
  1254. + </div>
  1255. + <div id="promo-content">
  1256. + <h1>NotABug.org</h1>
  1257. + <h2>Free code hosting</h2>
  1258. + <form id="promo-form" action="{{AppSubUrl}}/user/login" method="post">
  1259. + {{.CsrfTokenHtml}}
  1260. + <input class="ipt ipt-large" id="username" name="uname" type="text" placeholder="{{.i18n.Tr "home.uname_holder"}}"/>
  1261. + <input class="ipt ipt-large" name="password" type="password" placeholder="{{.i18n.Tr "home.password_holder"}}"/>
  1262. + <input name="from" type="hidden" value="home">
  1263. + <button class="btn btn-black btn-large">{{.i18n.Tr "sign_in"}}</button>
  1264. + {{if .ShowRegistrationButton}}
  1265. + <button class="btn btn-green btn-large" id="register-button">{{.i18n.Tr "register"}}</button>
  1266. + {{end}}
  1267. + </form>
  1268. + </div>&nbsp;
  1269. + </div>
  1270. +</div>
  1271. +<div id="feature-wrapper">
  1272. + <div class="container clear">
  1273. + <div class="grid-1-2 left">
  1274. + <img src="{{AppSubUrl}}/img/hack.png" alt="peers-logo" width="52px" />
  1275. + <b>Peers</b>
  1276. + <p>NotABug.org is a <a href="http://peers.community">Peers Community</a> project</p>
  1277. + </div>
  1278. + <div class="grid-1-2 left">
  1279. + <img src="{{AppSubUrl}}/img/gogs-lg.png" alt="gogs-logo" width="52px" />
  1280. + <b>Powered by gogs</b>
  1281. + <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>
  1282. + </div>
  1283. + </div>
  1284. +</div>
  1285. +{{template "ng/base/footer" .}}
  1286. ++=======
  1287. + {{template "base/head" .}}
  1288. + <div class="home">
  1289. + <div class="ui stackable middle very relaxed page grid">
  1290. + <div class="sixteen wide center aligned centered column">
  1291. + <div>
  1292. + <img class="logo" src="{{AppSubUrl}}/img/gogs-lg.png" />
  1293. + </div>
  1294. + <div class="hero">
  1295. + <h1 class="ui icon header title">
  1296. + Gogs - Go Git Service
  1297. + </h1>
  1298. + <h2>{{.i18n.Tr "app_desc"}}</h2>
  1299. + </div>
  1300. + </div>
  1301. + </div>
  1302. + {{if eq .Lang "de-DE"}}
  1303. + <div class="ui stackable middle very relaxed page grid">
  1304. + <div class="eight wide center column">
  1305. + <h1 class="hero ui icon header">
  1306. + <i class="octicon octicon-flame"></i> Einfach zu installieren
  1307. + </h1>
  1308. + <p class="large">
  1309. + 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>.
  1310. + </p>
  1311. + </div>
  1312. + <div class="eight wide center column">
  1313. + <h1 class="hero ui icon header">
  1314. + <i class="octicon octicon-device-desktop"></i> Plattformübergreifend
  1315. + </h1>
  1316. + <p class="large">
  1317. + 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!
  1318. + </p>
  1319. + </div>
  1320. + </div>
  1321. + <div class="ui stackable middle very relaxed page grid">
  1322. + <div class="eight wide center column">
  1323. + <h1 class="hero ui icon header">
  1324. + <i class="octicon octicon-rocket"></i> Leichtgewicht
  1325. + </h1>
  1326. + <p class="large">
  1327. + Gogs hat minimale Systemanforderungen und kann selbst auf einem günstigen und stromsparenden Raspberry Pi betrieben werden.
  1328. + </p>
  1329. + </div>
  1330. + <div class="eight wide center column">
  1331. + <h1 class="hero ui icon header">
  1332. + <i class="octicon octicon-code"></i> Quelloffen
  1333. + </h1>
  1334. + <p class="large">
  1335. + 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!
  1336. + </p>
  1337. + </div>
  1338. + </div>
  1339. + {{else if eq .Lang "zh-CN"}}
  1340. + <div class="ui stackable middle very relaxed page grid">
  1341. + <div class="eight wide center column">
  1342. + <h1 class="hero ui icon header">
  1343. + <i class="octicon octicon-flame"></i> 易安装
  1344. + </h1>
  1345. + <p class="large">
  1346. + 您除了可以根据操作系统平台通过 <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> 安装。
  1347. + </p>
  1348. + </div>
  1349. + <div class="eight wide center column">
  1350. + <h1 class="hero ui icon header">
  1351. + <i class="octicon octicon-device-desktop"></i> 跨平台
  1352. + </h1>
  1353. + <p class="large">
  1354. + 任何 <a target="_blank" href="http://golang.org/">Go 语言</a> 支持的平台都可以运行 Gogs,包括 Windows、Mac、Linux 以及 ARM。挑一个您喜欢的就行!
  1355. + </p>
  1356. + </div>
  1357. + </div>
  1358. + <div class="ui stackable middle very relaxed page grid">
  1359. + <div class="eight wide center column">
  1360. + <h1 class="hero ui icon header">
  1361. + <i class="octicon octicon-rocket"></i> 轻量级
  1362. + </h1>
  1363. + <p class="large">
  1364. + 一个廉价的树莓派的配置足以满足 Gogs 的最低系统硬件要求。最大程度上节省您的服务器资源!
  1365. + </p>
  1366. + </div>
  1367. + <div class="eight wide center column">
  1368. + <h1 class="hero ui icon header">
  1369. + <i class="octicon octicon-code"></i> 开源化
  1370. + </h1>
  1371. + <p class="large">
  1372. + 所有的代码都开源在 <a target="_blank" href="https://github.com/gogits/gogs/">GitHub</a> 上,赶快加入我们来共同发展这个伟大的项目!还等什么?成为贡献者吧!
  1373. + </p>
  1374. + </div>
  1375. + </div>
  1376. + {{else if eq .Lang "fr-FR"}}
  1377. + <div class="ui stackable middle very relaxed page grid">
  1378. + <div class="eight wide center column">
  1379. + <h1 class="hero ui icon header">
  1380. + <i class="octicon octicon-flame"></i> Facile à installer
  1381. + </h1>
  1382. + <p class="large">
  1383. + 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.
  1384. + Ou d'utiliser Gogs avec <a target="_blank" href="https://github.com/gogits/gogs/tree/master/docker">Docker</a> ou
  1385. + <a target="_blank" href="https://github.com/geerlingguy/ansible-vagrant-examples/tree/master/gogs">Vagrant</a>
  1386. + ou en l'installant depuis un <a target="_blank" href="http://gogs.io/docs/installation/install_from_packages.html">package</a>.
  1387. + </p>
  1388. + </div>
  1389. + <div class="eight wide center column">
  1390. + <h1 class="hero ui icon header">
  1391. + <i class="octicon octicon-device-desktop"></i> Multi-plateforme
  1392. + </h1>
  1393. + <p class="large">
  1394. + 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é !
  1395. + </p>
  1396. + </div>
  1397. + </div>
  1398. + <div class="ui stackable middle very relaxed page grid">
  1399. + <div class="eight wide center column">
  1400. + <h1 class="hero ui icon header">
  1401. + <i class="octicon octicon-rocket"></i> Léger
  1402. + </h1>
  1403. + <p class="large">
  1404. + Gogs utilise peu de ressources. Il peut même tourner sur un Raspberry Pi très bon marché. Économisez l'énergie de vos serveurs !
  1405. + </p>
  1406. + </div>
  1407. + <div class="eight wide center column">
  1408. + <h1 class="hero ui icon header">
  1409. + <i class="octicon octicon-code"></i> Open Source
  1410. + </h1>
  1411. + <p class="large">
  1412. + 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.
  1413. + </p>
  1414. + </div>
  1415. + </div>
  1416. + {{else if eq .Lang "es-ES"}}
  1417. + <div class="ui stackable middle very relaxed page grid">
  1418. + <div class="eight wide center column">
  1419. + <h1 class="hero ui icon header">
  1420. + <i class="octicon octicon-flame"></i> Fácil de instalar
  1421. + </h1>
  1422. + <p class="large">
  1423. + 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>.
  1424. + </p>
  1425. + </div>
  1426. + <div class="eight wide center column">
  1427. + <h1 class="hero ui icon header">
  1428. + <i class="octicon octicon-device-desktop"></i> Multiplatforma
  1429. + </h1>
  1430. + <p class="large">
  1431. + 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!
  1432. + </p>
  1433. + </div>
  1434. + </div>
  1435. + <div class="ui stackable middle very relaxed page grid">
  1436. + <div class="eight wide center column">
  1437. + <h1 class="hero ui icon header">
  1438. + <i class="octicon octicon-rocket"></i> Ligero
  1439. + </h1>
  1440. + <p class="large">
  1441. + Gogs tiene pocos requisitos y puede funcionar en una Raspberry Pi barata. !Ahorra energía!
  1442. + </p>
  1443. + </div>
  1444. + <div class="eight wide center column">
  1445. + <h1 class="hero ui icon header">
  1446. + <i class="octicon octicon-code"></i> Open Source
  1447. + </h1>
  1448. + <p class="large">
  1449. + ¡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!
  1450. + </p>
  1451. + </div>
  1452. + </div>
  1453. + {{else if eq .Lang "pt-BR"}}
  1454. + <div class="ui stackable middle very relaxed page grid">
  1455. + <div class="eight wide center column">
  1456. + <h1 class="hero ui icon header">
  1457. + <i class="octicon octicon-flame"></i> Fácil de instalar
  1458. + </h1>
  1459. + <p class="large">
  1460. + 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>.
  1461. + </p>
  1462. + </div>
  1463. + <div class="eight wide center column">
  1464. + <h1 class="hero ui icon header">
  1465. + <i class="octicon octicon-device-desktop"></i> Multi-plataforma
  1466. + </h1>
  1467. + <p class="large">
  1468. + 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!
  1469. + </p>
  1470. + </div>
  1471. + </div>
  1472. + <div class="ui stackable middle very relaxed page grid">
  1473. + <div class="eight wide center column">
  1474. + <h1 class="hero ui icon header">
  1475. + <i class="octicon octicon-rocket"></i> Leve e rápido
  1476. + </h1>
  1477. + <p class="large">
  1478. + Gogs utiliza poucos recursos e consegue mesmo rodar no barato Raspberry Pi. Economize energia elétrica da sua máquina!
  1479. + </p>
  1480. + </div>
  1481. + <div class="eight wide center column">
  1482. + <h1 class="hero ui icon header">
  1483. + <i class="octicon octicon-code"></i> Código aberto
  1484. + </h1>
  1485. + <p class="large">
  1486. + 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!
  1487. + </p>
  1488. + </div>
  1489. + </div>
  1490. + {{else if eq .Lang "ru-RU"}}
  1491. + <div class="ui stackable middle very relaxed page grid">
  1492. + <div class="eight wide center column">
  1493. + <h1 class="hero ui icon header">
  1494. + <i class="octicon octicon-flame"></i> Простой в установке
  1495. + </h1>
  1496. + <p class="large">
  1497. + Просто <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>.
  1498. + </p>
  1499. + </div>
  1500. + <div class="eight wide center column">
  1501. + <h1 class="hero ui icon header">
  1502. + <i class="octicon octicon-device-desktop"></i> Кроссплатформенный
  1503. + </h1>
  1504. + <p class="large">
  1505. + Gogs работает на любой операционной системе, которая может компилировать <a target="_blank" href="http://golang.org/">Go</a>: Windows, Mac OS X, Linux, ARM и т. д. Выбирайте, что вам больше нравится!
  1506. + </p>
  1507. + </div>
  1508. + </div>
  1509. + <div class="ui stackable middle very relaxed page grid">
  1510. + <div class="eight wide center column">
  1511. + <h1 class="hero ui icon header">
  1512. + <i class="octicon octicon-rocket"></i> Легковесный
  1513. + </h1>
  1514. + <p class="large">
  1515. + Gogs имеет низкие системные требования и может работать на недорогом Raspberry Pi. Экономьте энергию вашей машины!
  1516. + </p>
  1517. + </div>
  1518. + <div class="eight wide center column">
  1519. + <h1 class="hero ui icon header">
  1520. + <i class="octicon octicon-code"></i> Открытый исходный код
  1521. + </h1>
  1522. + <p class="large">
  1523. + Всё это на <a target="_blank" href="https://github.com/gogits/gogs/">GitHub</a>! Присоединяйтесь к нам, внося вклад, чтобы сделать этот проект еще лучше. Не бойтесь помогать!
  1524. + </p>
  1525. + </div>
  1526. + </div>
  1527. + {{else}}
  1528. + <div class="ui stackable middle very relaxed page grid">
  1529. + <div class="eight wide center column">
  1530. + <h1 class="hero ui icon header">
  1531. + <i class="octicon octicon-flame"></i> Easy to install
  1532. + </h1>
  1533. + <p class="large">
  1534. + 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>.
  1535. + </p>
  1536. + </div>
  1537. + <div class="eight wide center column">
  1538. + <h1 class="hero ui icon header">
  1539. + <i class="octicon octicon-device-desktop"></i> Cross-platform
  1540. + </h1>
  1541. + <p class="large">
  1542. + 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!
  1543. + </p>
  1544. + </div>
  1545. + </div>
  1546. + <div class="ui stackable middle very relaxed page grid">
  1547. + <div class="eight wide center column">
  1548. + <h1 class="hero ui icon header">
  1549. + <i class="octicon octicon-rocket"></i> Lightweight
  1550. + </h1>
  1551. + <p class="large">
  1552. + Gogs has low minimal requirements and can run on an inexpensive Raspberry Pi. Save your machine energy!
  1553. + </p>
  1554. + </div>
  1555. + <div class="eight wide center column">
  1556. + <h1 class="hero ui icon header">
  1557. + <i class="octicon octicon-code"></i> Open Source
  1558. + </h1>
  1559. + <p class="large">
  1560. + 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!
  1561. + </p>
  1562. + </div>
  1563. + </div>
  1564. + {{end}}
  1565. + </div>
  1566. + {{template "base/footer" .}}
  1567. ++>>>>>>> upstream/master
  1568. diff --cc templates/repo/issue/list.tmpl
  1569. index b165afa,ce8fd64..0000000
  1570. --- a/templates/repo/issue/list.tmpl
  1571. +++ b/templates/repo/issue/list.tmpl
  1572. @@@ -1,120 -1,155 +1,255 @@@
  1573. ++<<<<<<< HEAD
  1574. +{{template "base/head_old" .}}
  1575. +{{template "base/navbar" .}}
  1576. +{{template "repo/nav" .}}
  1577. +{{template "repo/toolbar" .}}
  1578. +<div id="body" class="container">
  1579. + <div id="issue">
  1580. + <div class="col-md-3 filters">
  1581. + <div class="filter-list">
  1582. + <ul class="list-unstyled">
  1583. + <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>
  1584. + <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>
  1585. + <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>
  1586. + <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>
  1587. + </ul>
  1588. + </div>
  1589. + <div class="label-filter">
  1590. + <h4>Label</h4>
  1591. + <ul class="list-unstyled" id="label-list" data-ajax="{{$.RepoLink}}/issues/labels/delete">
  1592. + {{range .Labels}}
  1593. + <li class="label-item{{if eq $.SelectLabels .Id}} label-selected{{end}}" id="label-{{.Id}}" data-id="{{.Id}}">
  1594. + <a href="?type={{$.ViewType}}&state={{$.State}}{{if not (eq $.SelectLabels .Id)}}&labels={{.Id}}{{end}}">
  1595. + <span class="pull-right count">{{if $.IsShowClosed}}{{.NumClosedIssues}}{{else}}{{.NumOpenIssues}}{{end}}</span>
  1596. + <span class="color" style="background-color: {{.Color}}" data-color="{{.Color}}"></span>
  1597. + <span class="name">{{.Name}}</span>
  1598. + </a>
  1599. + <a class="del pull-right" href="#" data-id="{{.Id}}"><i class="fa fa-times-circle-o"></i></a>
  1600. + </li>
  1601. + {{end}}
  1602. + {{if or .IsRepositoryOwner .IsAdmin}}
  1603. + <li class="label-change-li" style="display: none">
  1604. + <form id="label-change-form" action="{{$.RepoLink}}/issues/labels/edit" method="post">
  1605. + {{.CsrfTokenHtml}}
  1606. + <div class="input-group label-change-color-picker form-group" style="margin-bottom: 2px">
  1607. + <input type="text" class="form-control" name="title" required="required" id="label-name-change-ipt"/>
  1608. + <input type="hidden" name="color" id="label-color-change-ipt" value="#444444"/>
  1609. + <span class="input-group-addon"><i></i></span>
  1610. + <input type="hidden" name="id" id="label-change-id-ipt" value="0"/>
  1611. + </div>
  1612. + <div class="form-group text-right">
  1613. + <input class="form-control input-sm" type="text" id="label-color-change-ipt2" value="#444444"/>
  1614. + <button class="btn btn-default btn-sm">Save</button>
  1615. + </div>
  1616. + </form>
  1617. + </li>
  1618. + {{end}}
  1619. + </ul>
  1620. + {{if or .IsRepositoryOwner .IsAdmin}}
  1621. + <button class="btn btn-default btn-block label-button" id="label-manage-btn">Manage Labels</button>
  1622. + <hr/>
  1623. + <form id="label-add-form" action="{{$.RepoLink}}/issues/labels/new" method="post">
  1624. + {{.CsrfTokenHtml}}
  1625. + <h5><strong>New Label</strong></h5>
  1626. + <div class="input-group label-color-picker form-group">
  1627. + <input type="text" class="form-control" name="title" required="required" id="label-name-ipt"/>
  1628. + <input type="hidden" name="color" id="label-color-ipt" value="#444444"/>
  1629. + <span class="input-group-addon"><i></i></span>
  1630. + </div>
  1631. + <div class="form-group text-right">
  1632. + <input class="form-control input-sm" type="text" id="label-color-ipt2" value="#444444"/>
  1633. + <button class="btn btn-default btn-sm">Create</button>
  1634. + </div>
  1635. + </form>
  1636. + {{end}}
  1637. + </div>
  1638. + </div>
  1639. + <div class="col-md-9">
  1640. + {{template "base/alert" .}}
  1641. + <div class="filter-option">
  1642. + <div class="btn-group">
  1643. + <a class="btn btn-default issue-open{{if not .IsShowClosed}} active{{end}}" href="{{.RepoLink}}/issues?type={{.ViewType}}">{{.IssueStats.OpenCount}} Open</a>
  1644. + <a class="btn btn-default issue-close{{if .IsShowClosed}} active{{end}}" href="{{.RepoLink}}/issues?type={{.ViewType}}&state=closed">{{.IssueStats.ClosedCount}} Closed</a>
  1645. + </div>
  1646. + </div>
  1647. + <div class="issues list-group">
  1648. + {{range .Issues}}{{if .Poster}}
  1649. + <div class="list-group-item issue-item{{if not .IsRead}} unread{{end}}" id="issue-{{.Id}}">
  1650. + <span class="number pull-right">#{{.Index}}</span>
  1651. + <h5 class="title">
  1652. + <a href="{{$.RepoLink}}/issues/{{.Index}}">{{.Name}}</a>
  1653. + <span class="labels">
  1654. + {{range .Labels}}
  1655. + <span class="label" style="background-color: {{.Color}}">{{.Name}}</span>
  1656. + {{end}}
  1657. + </span>
  1658. + </h5>
  1659. + <p class="info">
  1660. + <span class="author"><img class="avatar" src="{{.Poster.AvatarLink}}" alt="" width="20"/>
  1661. + <a href="{{AppSubUrl}}/{{.Poster.Name}}">{{.Poster.Name}}</a></span>
  1662. + <span class="time">{{TimeSince .Created $.Lang}}</span>
  1663. + <span class="comment"><i class="fa fa-comments"></i> {{.NumComments}}</span>
  1664. + </p>
  1665. + </div>
  1666. + {{end}}{{end}}
  1667. + </div>
  1668. + </div>
  1669. + </div>
  1670. + </div>
  1671. ++=======
  1672. + {{template "base/head" .}}
  1673. + <div class="repository">
  1674. + {{template "repo/header" .}}
  1675. + <div class="ui container">
  1676. + <div class="navbar">
  1677. + {{template "repo/issue/navbar" .}}
  1678. + <div class="ui right">
  1679. + {{if .PageIsIssueList}}
  1680. + <a class="ui green button" href="{{.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a>
  1681. + {{else}}
  1682. + <a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{.RepoLink}}/compare/{{.Repository.DefaultBranch}}...{{.PullRequestCtx.HeadInfo}}">{{.i18n.Tr "repo.pulls.new"}}</a>
  1683. + {{end}}
  1684. + </div>
  1685. + </div>
  1686. + <div class="ui divider"></div>
  1687. + <div class="ui tiny basic status buttons">
  1688. + <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}}">
  1689. + <i class="octicon octicon-issue-opened"></i>
  1690. + {{.i18n.Tr "repo.issues.open_tab" .IssueStats.OpenCount}}
  1691. + </a>
  1692. + <a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{$.Link}}?type={{.ViewType}}&sort={{$.SortType}}&state=closed&labels={{.SelectLabels}}&milestone={{.MilestoneID}}&assignee={{.AssigneeID}}">
  1693. + <i class="octicon octicon-issue-closed"></i>
  1694. + {{.i18n.Tr "repo.issues.close_tab" .IssueStats.ClosedCount}}
  1695. + </a>
  1696. + </div>
  1697. + <div class="ui right floated secondary filter menu">
  1698. + <!-- Label -->
  1699. + <div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item">
  1700. + <span class="text">
  1701. + {{.i18n.Tr "repo.issues.filter_label"}}
  1702. + <i class="dropdown icon"></i>
  1703. + </span>
  1704. + <div class="menu">
  1705. + <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_label_no_select"}}</a>
  1706. + {{range .Labels}}
  1707. + <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>
  1708. + {{end}}
  1709. + </div>
  1710. + </div>
  1711. +
  1712. + <!-- Milestone -->
  1713. + <div class="ui {{if not .Milestones}}disabled{{end}} dropdown jump item">
  1714. + <span class="text">
  1715. + {{.i18n.Tr "repo.issues.filter_milestone"}}
  1716. + <i class="dropdown icon"></i>
  1717. + </span>
  1718. + <div class="menu">
  1719. + <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_milestone_no_select"}}</a>
  1720. + {{range .Milestones}}
  1721. + <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>
  1722. + {{end}}
  1723. + </div>
  1724. + </div>
  1725. +
  1726. + <!-- Assignee -->
  1727. + <div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
  1728. + <span class="text">
  1729. + {{.i18n.Tr "repo.issues.filter_assignee"}}
  1730. + <i class="dropdown icon"></i>
  1731. + </span>
  1732. + <div class="menu">
  1733. + <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}">{{.i18n.Tr "repo.issues.filter_assginee_no_select"}}</a>
  1734. + {{range .Assignees}}
  1735. + <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>
  1736. + {{end}}
  1737. + </div>
  1738. + </div>
  1739. +
  1740. + <!-- Type -->
  1741. + <div class="ui dropdown type jump item">
  1742. + <span class="text">
  1743. + {{.i18n.Tr "repo.issues.filter_type"}}
  1744. + <i class="dropdown icon"></i>
  1745. + </span>
  1746. + <div class="menu">
  1747. + <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>
  1748. + <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>
  1749. + <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>
  1750. + <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>
  1751. + </div>
  1752. + </div>
  1753. +
  1754. + <!-- Sort -->
  1755. + <div class="ui dropdown type jump item">
  1756. + <span class="text">
  1757. + {{.i18n.Tr "repo.issues.filter_sort"}}
  1758. + <i class="dropdown icon"></i>
  1759. + </span>
  1760. + <div class="menu">
  1761. + <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>
  1762. + <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>
  1763. + <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>
  1764. + <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>
  1765. + <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>
  1766. + <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>
  1767. + </div>
  1768. + </div>
  1769. + </div>
  1770. +
  1771. + <div class="issue list">
  1772. + {{range .Issues}}
  1773. + {{ $timeStr:= TimeSince .Created $.Lang }}
  1774. + <li class="item">
  1775. + <div class="ui {{if .IsRead}}black{{else}}green{{end}} label">#{{.Index}}</div>
  1776. + <a class="title has-emoji" href="{{$.Link}}/{{.Index}}">{{.Name}}</a>
  1777. +
  1778. + {{range .Labels}}
  1779. + <a class="ui label" href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}">{{.Name}}</a>
  1780. + {{end}}
  1781. +
  1782. + {{if .NumComments}}
  1783. + <span class="comment ui right"><i class="octicon octicon-comment"></i> {{.NumComments}}</span>
  1784. + {{end}}
  1785. +
  1786. + <p class="desc">
  1787. + {{$.i18n.Tr "repo.issues.opened_by" $timeStr .Poster.HomeLink .Poster.Name | Safe}}
  1788. + {{if .Milestone}}
  1789. + <a class="milestone" href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.Milestone.ID}}&assignee={{$.AssigneeID}}">
  1790. + <span class="octicon octicon-milestone"></span> {{.Milestone.Name}}
  1791. + </a>
  1792. + {{end}}
  1793. + {{if .Assignee}}
  1794. + <a class="ui right assignee poping up" href="{{.Assignee.HomeLink}}" data-content="{{.Assignee.Name}}" data-variation="inverted" data-position="left center">
  1795. + <img class="ui avatar image" src="{{.Assignee.AvatarLink}}">
  1796. + </a>
  1797. + {{end}}
  1798. + </p>
  1799. + </li>
  1800. + {{end}}
  1801. +
  1802. + {{with .Page}}
  1803. + {{if gt .TotalPages 1}}
  1804. + <div class="center page buttons">
  1805. + <div class="ui borderless pagination menu">
  1806. + <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}}>
  1807. + <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}}
  1808. + </a>
  1809. + {{range .Pages}}
  1810. + {{if eq .Num -1}}
  1811. + <a class="disabled item">...</a>
  1812. + {{else}}
  1813. + <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>
  1814. + {{end}}
  1815. + {{end}}
  1816. + <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}}>
  1817. + {{$.i18n.Tr "repo.issues.next"}}&nbsp;<i class="icon right arrow"></i>
  1818. + </a>
  1819. + </div>
  1820. + </div>
  1821. + {{end}}
  1822. + {{end}}
  1823. + </div>
  1824. + </div>
  1825. ++>>>>>>> upstream/master
  1826. </div>
  1827. - <script src="/js/bootstrap-colorpicker.min.js"></script>
  1828. - <script>
  1829. - $(function(){
  1830. - $('.label-color-picker').colorpicker({
  1831. - input: $('#label-color-ipt')
  1832. - }).on('changeColor', function (ev) {
  1833. - var $ipt = $('#label-color-ipt2');
  1834. - if ($ipt.val().length != 4) {
  1835. - $ipt.val(ev.color.toHex());
  1836. - }
  1837. - });
  1838. - $('.label-change-color-picker').colorpicker({
  1839. - input:$('#label-color-change-ipt')
  1840. - }).on('changeColor', function (ev) {
  1841. - var $ipt = $('#label-color-change-ipt2');
  1842. - if ($ipt.val().length != 4) {
  1843. - $ipt.val(ev.color.toHex());
  1844. - }
  1845. - });
  1846. - });
  1847. - </script>
  1848. - {{template "base/footer_old" .}}
  1849. + {{template "base/footer" .}}
  1850. diff --cc templates/repo/issue/view.tmpl
  1851. index 4ece2ab,2260f17..0000000
  1852. --- a/templates/repo/issue/view.tmpl
  1853. +++ b/templates/repo/issue/view.tmpl
  1854. @@@ -1,282 -1,29 +1,312 @@@
  1855. ++<<<<<<< HEAD
  1856. +{{template "base/head_old" .}}
  1857. +{{template "base/navbar" .}}
  1858. +{{template "repo/nav" .}}
  1859. +{{template "repo/toolbar" .}}
  1860. +<div id="body" class="container">
  1861. + <div id="issue" data-id="{{.Issue.Id}}">
  1862. + <div id="issue-{{.Issue.Id}}" class="issue-whole issue-is-opening">
  1863. + <div class="issue-wrap col-md-10">
  1864. + <div class="issue-head clearfix">
  1865. + <div class="number pull-right">#{{.Issue.Index}}</div>
  1866. + <a class="author pull-left" href="{{AppSubUrl}}/{{.Issue.Poster.Name}}"><img class="avatar" src="{{.Issue.Poster.AvatarLink}}" alt="" width="30"/></a>
  1867. + <h1 class="title pull-left">{{.Issue.Name}}</h1>
  1868. + <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"/>
  1869. + <input type="hidden" value="{{.Issue.Id}}" data-ajax-rel="issue-edit-save" data-ajax-val="val" data-ajax-field="issue_id"/>
  1870. + <p class="info pull-left">
  1871. + {{if .IsIssueOwner}}<a class="btn btn-default pull-right issue-edit" href="#" id="issue-edit-btn">Edit</a>
  1872. + <a class="btn btn-danger pull-right issue-edit-cancel hidden" href="#">Cancel</a>
  1873. + <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}}
  1874. + <span class="status label label-{{if .Issue.IsClosed}}danger{{else}}success{{end}}">{{if .Issue.IsClosed}}Closed{{else}}Open{{end}}</span>
  1875. + <a href="{{AppSubUrl}}/{{.Issue.Poster.Name}}" class="author"><strong>{{.Issue.Poster.Name}}</strong></a> opened this issue
  1876. + <span class="time">{{TimeSince .Issue.Created $.Lang}}</span> · {{.Issue.NumComments}} comments
  1877. + </p>
  1878. + </div>
  1879. + <div class="issue-main">
  1880. + <div class="panel panel-default issue-content">
  1881. + <div class="panel-body">
  1882. + <div class="content markdown">
  1883. + {{Str2html .Issue.RenderedContent}}
  1884. + </div>
  1885. + <div class="issue-edit-content hidden">
  1886. + <div class="form-group">
  1887. + <div class="md-help pull-right">Content with <a href="https://help.github.com/articles/markdown-basics">Markdown</a>
  1888. + </div>
  1889. + <ul class="nav nav-tabs" data-init="tabs">
  1890. + <li class="issue-write active"><a href="#issue-edit-textarea" data-toggle="tab">Write</a></li>
  1891. + <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>
  1892. + </ul>
  1893. + <div class="tab-content">
  1894. + <div class="tab-pane active" id="issue-edit-textarea">
  1895. + <div class="form-group">
  1896. + <input type="hidden" value="1" name="issueIndex">
  1897. + <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>
  1898. + </div>
  1899. + </div>
  1900. + <div class="tab-pane issue-preview-content" id="issue-edit-preview">Loading...</div>
  1901. + </div>
  1902. + </div>
  1903. + </div>
  1904. + </div>
  1905. + {{with $attachments := .Issue.Attachments}}
  1906. + {{if $attachments}}
  1907. + <div class="attachments">
  1908. + <span class="attachment-label label label-info">Attachments:</span>
  1909. +
  1910. + {{range $attachments}}
  1911. + <a class="attachment label label-default" href="{{.IssueId}}/attachment/{{.Id}}">{{.Name}}</a>
  1912. + {{end}}
  1913. + </div>
  1914. + {{end}}
  1915. + {{end}}
  1916. + </div>
  1917. + {{range .Comments}}
  1918. + {{/* 0 = COMMENT, 1 = REOPEN, 2 = CLOSE, 3 = ISSUE, 4 = COMMIT, 5 = PULL */}}
  1919. + {{if eq .Type 0}}
  1920. + <div class="issue-child" id="issue-comment-{{.Id}}">
  1921. + <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a>
  1922. + <div class="issue-content panel panel-default">
  1923. + <div class="panel-heading">
  1924. + <a href="{{AppSubUrl}}/{{.Poster.Name}}" class="user">{{.Poster.Name}}</a> commented <span class="time">{{TimeSince .Created $.Lang}}</span>
  1925. + <!-- <a class="issue-comment-del pull-right issue-action" href="#" title="Edit Comment"><i class="fa fa-times-circle"></i></a>
  1926. + <a class="issue-comment-edit pull-right issue-action" href="#" title="Remove Comment" data-url="{remove-link}"><i class="fa fa-edit"></i></a> -->
  1927. + <!-- <span class="role label label-default pull-right">Owner</span> -->
  1928. + </div>
  1929. + <div class="panel-body markdown">
  1930. + {{if len .Content}}
  1931. + {{Str2html .Content}}
  1932. + {{else}}
  1933. + <i>No comment entered</i>
  1934. + {{end}}
  1935. + </div>
  1936. + {{with $attachments := .Attachments}}
  1937. + {{if $attachments}}
  1938. + <div class="attachments">
  1939. + <span class="attachment-label label label-info">Attachments:</span>
  1940. +
  1941. + {{range $attachments}}
  1942. + <a class="attachment label label-default" href="{{.IssueId}}/attachment/{{.Id}}">{{.Name}}</a>
  1943. + {{end}}
  1944. + </div>
  1945. + {{end}}
  1946. + {{end}}
  1947. + </div>
  1948. + </div>
  1949. + {{else if eq .Type 1}}
  1950. + <div class="issue-child issue-opened">
  1951. + <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt="" /></a>
  1952. + <div class="issue-content">
  1953. + <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>
  1954. + </div>
  1955. + </div>
  1956. + {{else if eq .Type 2}}
  1957. + <div class="issue-child issue-closed">
  1958. + <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a>
  1959. + <div class="issue-content">
  1960. + <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>
  1961. + </div>
  1962. + </div>
  1963. + {{else if eq .Type 4}}
  1964. + <div class="issue-child issue-reference issue-reference-commit">
  1965. + <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a>
  1966. + <div class="issue-content">
  1967. + <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>
  1968. + <p>
  1969. + <a class="user pull-left" href="{{AppSubUrl}}/{{.Poster.Name}}"><img class="avatar" src="{{.Poster.AvatarLink}}" alt=""/></a>
  1970. + {{.ContentHtml}}
  1971. + </p>
  1972. + </div>
  1973. + </div>
  1974. + {{end}}
  1975. + {{end}}
  1976. + <hr class="issue-line"/>
  1977. + {{if .SignedUser}}<div class="issue-child issue-reply">
  1978. + <a class="user pull-left" href="{{AppSubUrl}}/{{.SignedUser.Name}}"><img class="avatar" src="{{.SignedUser.AvatarLink}}" alt=""/></a>
  1979. + <form class="panel panel-default issue-content" action="{{.RepoLink}}/comment/new" method="post" enctype="multipart/form-data">
  1980. + {{.CsrfTokenHtml}}
  1981. + <div class="panel-body">
  1982. + <div class="form-group">
  1983. + <div class="md-help pull-right">Content with <a href="https://help.github.com/articles/markdown-basics">Markdown</a>
  1984. + </div>
  1985. + <ul class="nav nav-tabs" data-init="tabs">
  1986. + <li class="active issue-write"><a href="#issue-textarea" data-toggle="tab">Write</a></li>
  1987. + <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>
  1988. + </ul>
  1989. + <div class="tab-content">
  1990. + <div class="tab-pane" id="issue-textarea">
  1991. + <div class="form-group">
  1992. + <div id="submit-error" class="text-danger"></div>
  1993. + <input type="hidden" value="{{.Issue.Index}}" name="issueIndex"/>
  1994. + <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>
  1995. + </div>
  1996. + </div>
  1997. + <div class="tab-pane issue-preview-content" id="issue-preview">Loading...</div>
  1998. + </div>
  1999. + </div>
  2000. + {{if .AttachmentsEnabled}}
  2001. + <div id="attached">
  2002. + <div id="attached-list">
  2003. + <b>Attachments:</b>
  2004. + </div>
  2005. + </div>
  2006. + {{end}}
  2007. + <div class="text-right">
  2008. + <div class="form-group">
  2009. + {{if .AttachmentsEnabled}}
  2010. + <input type="file" accept="{{.AllowedTypes}}" style="display: none;" id="attachments-input" name="attachments" multiple />
  2011. + <button class="btn-default btn attachment-add" id="attachments-button">Select Attachments...</button>
  2012. + {{end}}
  2013. + {{if .IsIssueOwner}}{{if .Issue.IsClosed}}
  2014. + <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}}
  2015. + <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}}&nbsp;&nbsp;
  2016. + <button class="btn-success btn" id="issue-reply-btn">Comment</button>
  2017. + </div>
  2018. + </div>
  2019. + </div>
  2020. + </form>
  2021. + </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}}
  2022. + </div>
  2023. + </div>
  2024. +
  2025. + <div class="issue-bar col-md-2">
  2026. + <div class="labels" data-ajax="{{.Issue.Index}}/label">
  2027. + {{if .IsRepositoryOwner}}
  2028. + <div class="pull-right action">
  2029. + <button class="btn btn-default btn-sm" data-toggle="dropdown">
  2030. + <i class="fa fa-tags"></i>
  2031. + <span class="caret"></span>
  2032. + </button>
  2033. + <div class="dropdown-menu dropdown-menu-right no">
  2034. + <ul class="list-unstyled">
  2035. + {{range .Labels}}
  2036. + <li class="{{if not .IsChecked}}no-{{end}}checked" data-id="{{.Id}}">
  2037. + {{if .IsChecked}}<span class="check pull-left"><i class="fa fa-check"></i></span>{{end}}
  2038. + <span class="color" style="background-color: {{.Color}}"></span>
  2039. + <span class="name">{{.Name}}</span>
  2040. + </li>
  2041. + {{end}}
  2042. + </ul>
  2043. + </div>
  2044. + </div>
  2045. + {{end}}
  2046. + <h4>Labels</h4>
  2047. + {{if .Issue.Labels}}
  2048. + {{range .Issue.Labels}}
  2049. + <p id="label-{{.Id}}" class="label-item label-white" style="background-color: {{.Color}}"><strong>{{.Name}}</strong></p>
  2050. + {{end}}
  2051. + {{else}}
  2052. + <p>None yet</p>
  2053. + {{end}}
  2054. + </div>
  2055. + <div class="milestone" data-milestone="{{.Milestone.Id}}" data-ajax="{{.Issue.Index}}/milestone">
  2056. + <div class="pull-right action">
  2057. + {{if .IsRepositoryOwner}}
  2058. + <button class="btn btn-default btn-sm" data-toggle="dropdown">
  2059. + <i class="fa fa-check-square-o"></i>
  2060. + <span class="caret"></span>
  2061. + </button>
  2062. + <div class="dropdown-menu dropdown-menu-right">
  2063. + <ul class="list-unstyled">
  2064. + <li data-id="0" class="clear-milestone milestone-item hidden"><i class="fa fa-times-circle-o"></i> Clear milestone </li>
  2065. + <li class="milestone-list">
  2066. + <ul class="nav nav-tabs" data-init="tabs">
  2067. + <li class="active"><a href="#milestone-open" data-toggle="tab">Open</a></li>
  2068. + <li><a href="#milestone-close" data-toggle="tab">Closed</a></li>
  2069. + </ul>
  2070. + <div class="tab-content">
  2071. + <div class="tab-pane active" id="milestone-open">
  2072. + {{if not .OpenMilestones}}
  2073. + <p class="milestone-item">Nothing to show</p>
  2074. + {{else}}
  2075. + <ul class="list-unstyled">
  2076. + {{range .OpenMilestones}}
  2077. + <li class="milestone-item" data-id="{{.Id}}">
  2078. + <p><strong>{{.Name}}</strong></p>
  2079. + <!-- <p>due to 3 days later</p> -->
  2080. + </li>
  2081. + {{end}}
  2082. + </ul>
  2083. + {{end}}
  2084. + </div>
  2085. +
  2086. + <div class="tab-pane" id="milestone-close">
  2087. + {{if not .ClosedMilestones}}
  2088. + <p class="milestone-item">Nothing to show</p>
  2089. + {{else}}
  2090. + <ul class="list-unstyled">
  2091. + {{range .ClosedMilestones}}
  2092. + <li class="milestone-item" data-id="{{.Id}}">
  2093. + <p><strong>{{.Name}}</strong></p>
  2094. + <p>Closed {{TimeSince .ClosedDate $.Lang}}</p>
  2095. + </li>
  2096. + {{end}}
  2097. + </ul>
  2098. + {{end}}
  2099. + </div>
  2100. + </div>
  2101. + </li>
  2102. + </ul>
  2103. + </div>
  2104. + {{end}}
  2105. + </div>
  2106. + <h4>Milestone</h4>
  2107. + {{if .Milestone}}
  2108. + <p class="completion{{if eq .Milestone.Completeness 0}} hidden{{end}}"><span style="width:{{.Milestone.Completeness}}%">&nbsp;</span></p>
  2109. + <p class="name"><strong><a href="{{$.RepoLink}}/issues?milestone={{.Milestone.Index}}{{if $.Issue.IsClosed}}&state=closed{{end}}">{{.Milestone.Name}}</a></strong></p>
  2110. + {{else}}
  2111. + <p class="name">No milestone</p>
  2112. + {{end}}
  2113. + </div>
  2114. +
  2115. + <div class="assignee" data-assigned="{{if .Issue.Assignee}}{{.Issue.Assignee.Id}}{{else}}0{{end}}" data-ajax="{{.Issue.Index}}/assignee">{{if .IsRepositoryOwner}}
  2116. + <div class="pull-right action">
  2117. + <button type="button" class="dropdown-toggle btn btn-default btn-sm" data-toggle="dropdown">
  2118. + <i class="fa fa-group"></i>
  2119. + <span class="caret"></span>
  2120. + </button>
  2121. + <div class="dropdown-menu dropdown-menu-right">
  2122. + <ul class="list-unstyled">
  2123. + <li data-uid="0" class="clear-assignee hidden"><i class="fa fa-times-circle-o"></i> Clear assignee</li>
  2124. + {{range .Collaborators}}
  2125. + <li data-uid="{{.Id}}"><img src="{{.AvatarLink}}"><strong>{{.Name}}</strong></li>
  2126. + {{end}}
  2127. + </ul>
  2128. + </div>
  2129. + </div>{{end}}
  2130. + <h4>Assignee</h4>
  2131. + <p>{{if .Issue.Assignee}}<img src="{{.Issue.Assignee.AvatarLink}}"><strong>{{.Issue.Assignee.Name}}</strong>{{else}}No one assigned{{end}}</p>
  2132. + </div>
  2133. + </div>
  2134. + </div>
  2135. + </div>
  2136. ++=======
  2137. + {{template "base/head" .}}
  2138. + <div class="repository view issue pull">
  2139. + {{template "repo/header" .}}
  2140. + <div class="ui container">
  2141. + <div class="navbar">
  2142. + {{template "repo/issue/navbar" .}}
  2143. + <div class="ui right">
  2144. + {{if .PageIsIssueList}}
  2145. + <a class="ui green button" href="{{.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a>
  2146. + {{else}}
  2147. + <a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{.RepoLink}}/compare/{{.BranchName}}...{{.PullRequestCtx.HeadInfo}}">{{.i18n.Tr "repo.pulls.new"}}</a>
  2148. + {{end}}
  2149. + </div>
  2150. + </div>
  2151. + <div class="ui divider"></div>
  2152. + {{if .Issue.IsPull}}
  2153. + {{template "repo/issue/view_title" .}}
  2154. + {{template "repo/pulls/tab_menu" .}}
  2155. + <div class="ui bottom attached tab pull segment active" data-tab="request-{{.ID}}">
  2156. + {{template "repo/issue/view_content" .}}
  2157. + </div>
  2158. + {{else}}
  2159. + <div>
  2160. + {{template "repo/issue/view_content" .}}
  2161. + </div>
  2162. + {{end}}
  2163. + </div>
  2164. ++>>>>>>> upstream/master
  2165. </div>
  2166. - {{template "base/footer_old" .}}
  2167. + {{template "base/footer" .}}
  2168. diff --cc templates/repo/settings/hook_new.tmpl
  2169. index d37e4a1,9612352..0000000
  2170. --- a/templates/repo/settings/hook_new.tmpl
  2171. +++ b/templates/repo/settings/hook_new.tmpl
  2172. @@@ -1,36 -1,28 +1,64 @@@
  2173. ++<<<<<<< HEAD
  2174. +{{template "ng/base/head" .}}
  2175. +{{template "ng/base/header" .}}
  2176. +<div id="repo-wrapper">
  2177. + {{template "repo/header" .}}
  2178. + <div id="setting-wrapper" class="main-wrapper">
  2179. + <div id="repo-setting" class="container clear">
  2180. + {{template "repo/settings/nav" .}}
  2181. + <div class="grid-4-5 left">
  2182. + <div class="setting-content">
  2183. + {{template "ng/base/alert" .}}
  2184. + <div id="setting-content">
  2185. + <div id="repo-hooks-panel" class="panel panel-radius">
  2186. + <div class="panel-header">
  2187. + <strong>{{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}}</strong>
  2188. + </div>
  2189. + {{template "repo/settings/hook_gogs" .}}
  2190. + </div>
  2191. + </div>
  2192. + {{if .PageIsSettingsHooksEdit}}
  2193. + <br>
  2194. + <div id="setting-content">
  2195. + <div id="repo-hooks-history-panel" class="panel panel-radius">
  2196. + <div class="panel-header">
  2197. + <strong>{{.i18n.Tr "repo.settings.recent_deliveries"}}</strong>
  2198. + </div>
  2199. + <ul class="panel-body setting-list">
  2200. + <li>Coming soon!</li>
  2201. + </ul>
  2202. + </div>
  2203. + </div>
  2204. + {{end}}
  2205. + </div>
  2206. + </div>
  2207. ++=======
  2208. + {{template "base/head" .}}
  2209. + <div class="repository settings new webhook">
  2210. + {{template "repo/header" .}}
  2211. + <div class="ui container">
  2212. + <div class="ui grid">
  2213. + {{template "repo/settings/navbar" .}}
  2214. + <div class="twelve wide column content">
  2215. + {{template "base/alert" .}}
  2216. + <h4 class="ui top attached header">
  2217. + {{if .PageIsSettingsHooksNew}}{{.i18n.Tr "repo.settings.add_webhook"}}{{else}}{{.i18n.Tr "repo.settings.update_webhook"}}{{end}}
  2218. + <div class="ui right">
  2219. + {{if eq .HookType "gogs"}}
  2220. + <img class="img-13" src="{{AppSubUrl}}/img/favicon.png">
  2221. + {{else if eq .HookType "slack"}}
  2222. + <img class="img-13" src="{{AppSubUrl}}/img/slack.png">
  2223. + {{end}}
  2224. + </div>
  2225. + </h4>
  2226. + <div class="ui attached segment">
  2227. + {{template "repo/settings/hook_gogs" .}}
  2228. + {{template "repo/settings/hook_slack" .}}
  2229. + </div>
  2230. +
  2231. + {{template "repo/settings/hook_history" .}}
  2232. + </div>
  2233. ++>>>>>>> upstream/master
  2234. </div>
  2235. </div>
  2236. </div>
  2237. diff --cc templates/status/404.tmpl
  2238. index 78a7cdf,776f4fb..0000000
  2239. --- a/templates/status/404.tmpl
  2240. +++ b/templates/status/404.tmpl
  2241. @@@ -1,10 -1,9 +1,20 @@@
  2242. ++<<<<<<< HEAD
  2243. +{{template "ng/base/head" .}}
  2244. +{{template "ng/base/header" .}}
  2245. +<div class="container text-center">
  2246. + <p style="margin-top: 100px"><img src="{{AppSubUrl}}/img/404.png" alt="404"/></p>
  2247. + <hr/>
  2248. + <br>
  2249. + <p>Application Version: {{AppVer}}</p>
  2250. + <p>If you think this is an error, please open an issue <a href="{{AppSubUrl}}/hp/gogs/issues/new">Here</a>.</p>
  2251. ++=======
  2252. + {{template "base/head" .}}
  2253. + <div class="ui container center">
  2254. + <p style="margin-top: 100px"><img src="{{AppSubUrl}}/img/404.png" alt="404"/></p>
  2255. + <div class="ui divider"></div>
  2256. + <br>
  2257. + {{if .ShowFooterVersion}}<p>Application Version: {{AppVer}}</p>{{end}}
  2258. + <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>
  2259. ++>>>>>>> upstream/master
  2260. </div>
  2261. - {{template "ng/base/footer" .}}
  2262. + {{template "base/footer" .}}
  2263. diff --cc templates/user/auth/signup.tmpl
  2264. index dbcb642,86c020d..0000000
  2265. --- a/templates/user/auth/signup.tmpl
  2266. +++ b/templates/user/auth/signup.tmpl
  2267. @@@ -1,41 -1,56 +1,100 @@@
  2268. ++<<<<<<< HEAD
  2269. +{{template "ng/base/head" .}}
  2270. +{{template "ng/base/header" .}}
  2271. +<div id="sign-wrapper">
  2272. + <form class="form-align form panel panel-radius sign-panel sign-form container" id="sign-up-form" action="{{AppSubUrl}}/user/sign_up" method="post">
  2273. + <div class="panel-header">
  2274. + <h2>{{if .IsSocialLogin}}{{.i18n.Tr "social_sign_in" | Str2html}}{{else}}{{.i18n.Tr "sign_up"}}{{end}}</h2>
  2275. + </div>
  2276. + <div class="panel-content">
  2277. + {{template "ng/base/alert" .}}
  2278. + {{if .DisableRegistration}}
  2279. + <p>{{.i18n.Tr "auth.disable_register_prompt"}}</p>
  2280. + {{else}}
  2281. + <div class="field">
  2282. + <label class="req" for="username">{{.i18n.Tr "username"}}</label>
  2283. + <input class="ipt ipt-large ipt-radius {{if .Err_UserName}}ipt-error{{end}}" id="username" name="uname" type="text" value="{{.uname}}" required/>
  2284. + </div>
  2285. + <div class="field">
  2286. + <label class="req" for="email">{{.i18n.Tr "email"}}</label>
  2287. + <input class="ipt ipt-large ipt-radius {{if .Err_Email}}ipt-error{{end}}" id="email" name="email" type="email" value="{{.email}}" required />
  2288. + </div>
  2289. + <div class="field">
  2290. + <label class="req" for="password">{{.i18n.Tr "password"}}</label>
  2291. + <input class="ipt ipt-large ipt-radius {{if .Err_Password}}ipt-error{{end}}" id="password" name="password" type="password" value="{{.password}}" required/>
  2292. + </div>
  2293. + <div class="field">
  2294. + <label class="req" for="re-type">{{.i18n.Tr "re_type"}}</label>
  2295. + <input class="ipt ipt-large ipt-radius {{if .Err_Password}}ipt-error{{end}}" id="re-type" name="retype" type="password" required/>
  2296. + </div>
  2297. + <div class="field">
  2298. + <span class="form-label"></span>
  2299. + <button class="btn btn-blue btn-large btn-radius">{{.i18n.Tr "auth.create_new_account"}}</button>
  2300. + </div>
  2301. + <div class="field">
  2302. + <span class="form-label"></span>
  2303. + <a href="{{AppSubUrl}}/user/login">{{if .IsSocialLogin}}{{.i18n.Tr "auth.social_register_hepler_msg"}}{{else}}{{.i18n.Tr "auth.register_hepler_msg"}}{{end}}</a>
  2304. + </div>
  2305. + {{end}}
  2306. + </div>
  2307. + </form>
  2308. +</div>
  2309. +{{template "ng/base/footer" .}}
  2310. ++=======
  2311. + {{template "base/head" .}}
  2312. + <div class="user signup">
  2313. + <div class="ui middle very relaxed page grid">
  2314. + <div class="column">
  2315. + <form class="ui form" action="{{.Link}}" method="post">
  2316. + {{.CsrfTokenHtml}}
  2317. + <h3 class="ui top attached header">
  2318. + {{if .IsSocialLogin}}{{.i18n.Tr "social_sign_in" | Str2html}}{{else}}{{.i18n.Tr "sign_up"}}{{end}}
  2319. + </h3>
  2320. + <div class="ui attached segment">
  2321. + {{template "base/alert" .}}
  2322. + {{if .DisableRegistration}}
  2323. + <p>{{.i18n.Tr "auth.disable_register_prompt"}}</p>
  2324. + {{else}}
  2325. + <div class="required inline field {{if .Err_UserName}}error{{end}}">
  2326. + <label for="user_name">{{.i18n.Tr "username"}}</label>
  2327. + <input id="user_name" name="user_name" value="{{.user_name}}" autofocus required>
  2328. + </div>
  2329. + <div class="required inline field {{if .Err_Email}}error{{end}}">
  2330. + <label for="email">{{.i18n.Tr "email"}}</label>
  2331. + <input id="email" name="email" type="email" value="{{.email}}" required>
  2332. + </div>
  2333. + <div class="required inline field {{if .Err_Password}}error{{end}}">
  2334. + <label for="password">{{.i18n.Tr "password"}}</label>
  2335. + <input id="password" name="password" type="password" value="{{.password}}" required>
  2336. + </div>
  2337. + <div class="required inline field {{if .Err_Password}}error{{end}}">
  2338. + <label for="retype">{{.i18n.Tr "re_type"}}</label>
  2339. + <input id="retype" name="retype" type="password" value="{{.retype}}" required>
  2340. + </div>
  2341. + {{if .EnableCaptcha}}
  2342. + <div class="inline field">
  2343. + <label></label>
  2344. + {{.Captcha.CreateHtml}}
  2345. + </div>
  2346. + <div class="required inline field {{if .Err_Captcha}}error{{end}}">
  2347. + <label for="captcha">{{.i18n.Tr "captcha"}}</label>
  2348. + <input id="captcha" name="captcha" value="{{.captcha}}" autocomplete="off">
  2349. + </div>
  2350. + {{end}}
  2351. +
  2352. + <div class="inline field">
  2353. + <label></label>
  2354. + <button class="ui green button">{{.i18n.Tr "auth.create_new_account"}}</button>
  2355. + </div>
  2356. + <div class="inline field">
  2357. + <label></label>
  2358. + <a href="{{AppSubUrl}}/user/login">{{if .IsSocialLogin}}{{.i18n.Tr "auth.social_register_hepler_msg"}}{{else}}{{.i18n.Tr "auth.register_hepler_msg"}}{{end}}</a>
  2359. + </div>
  2360. + {{end}}
  2361. + </div>
  2362. + </form>
  2363. + </div>
  2364. + </div>
  2365. + </div>
  2366. + {{template "base/footer" .}}
  2367. ++>>>>>>> upstream/master
  2368. diff --cc templates/user/dashboard/feeds.tmpl
  2369. index d7c8a08,00982e5..0000000
  2370. --- a/templates/user/dashboard/feeds.tmpl
  2371. +++ b/templates/user/dashboard/feeds.tmpl
  2372. @@@ -1,45 -1,82 +1,128 @@@
  2373. {{range .Feeds}}
  2374. ++<<<<<<< HEAD
  2375. +<div class="news clear">
  2376. + <div class="avatar left">
  2377. + <img class="avatar-30" src="{{.ActAvatar}}" alt="">
  2378. + </div>
  2379. + <div class="content left {{if eq .GetOpType 5}}push-news{{end}} grid-4-5">
  2380. + <p class="text-bold">
  2381. + <a href="{{AppSubUrl}}/{{.GetActUserName}}">{{.GetActUserName}}</a>
  2382. + {{if eq .GetOpType 1}}
  2383. + {{$.i18n.Tr "action.create_repo" .GetRepoLink .GetRepoPath | Str2html}}
  2384. + {{else if eq .GetOpType 5}}
  2385. + {{$.i18n.Tr "action.commit_repo" .GetRepoLink .GetBranch .GetRepoPath | Str2html}}
  2386. + {{else if eq .GetOpType 6}}
  2387. + {{ $index := index .GetIssueInfos 0}}
  2388. + {{$.i18n.Tr "action.create_issue" .GetRepoLink $index .GetRepoPath | Str2html}}
  2389. + {{else if eq .GetOpType 8}}
  2390. + {{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .GetRepoPath | Str2html}}
  2391. + {{else if eq .GetOpType 9}}
  2392. + {{$.i18n.Tr "action.push_tag" .GetRepoLink .GetBranch .GetRepoPath | Str2html}}
  2393. + {{else if eq .GetOpType 10}}
  2394. + {{ $index := index .GetIssueInfos 0}}
  2395. + {{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .GetRepoPath | Str2html}}
  2396. + {{end}}
  2397. + </p>
  2398. + {{if eq .GetOpType 5}}
  2399. + <div class="news-content content">
  2400. + <ul class="list-no-style">
  2401. + {{ $push := ActionContent2Commits .}}
  2402. + {{ $repoLink := .GetRepoLink}}
  2403. + {{range $push.Commits}}
  2404. + <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>
  2405. + {{end}}
  2406. + {{if $push.CompareUrl}}<li><a href="{{$push.CompareUrl}}">{{$.i18n.Tr "action.compare_2_commits"}} »</a></li>{{end}}
  2407. + </ul>
  2408. + </div>
  2409. + {{else if eq .GetOpType 6}}
  2410. + <p class="news-content comment-news">{{index .GetIssueInfos 1}}</p>
  2411. + {{else if eq .GetOpType 10}}
  2412. + <p class="news-content comment-news">{{index .GetIssueInfos 1}}</p>
  2413. + {{end}}
  2414. + <p class="news-time text-italic">{{TimeSince .GetCreate $.i18n.Lang}}</p>
  2415. + </div>
  2416. + <i class="mega-octicon octicon-{{ActionIcon .GetOpType}} right"></i>
  2417. +</div>
  2418. ++=======
  2419. + <div class="news">
  2420. + <div class="ui left">
  2421. + <img class="ui avatar image" src="{{.ActAvatar}}" alt="">
  2422. + </div>
  2423. + <div class="ui grid">
  2424. + <div class="ui fifteen wide column">
  2425. + <div class="{{if eq .GetOpType 5}}push news{{end}}">
  2426. + <p>
  2427. + <a href="{{AppSubUrl}}/{{.GetActUserName}}">{{.ShortActUserName}}</a>
  2428. + {{if eq .GetOpType 1}}
  2429. + {{$.i18n.Tr "action.create_repo" .GetRepoLink .ShortRepoPath | Str2html}}
  2430. + {{else if eq .GetOpType 2}}
  2431. + {{$.i18n.Tr "action.rename_repo" .GetContent .GetRepoLink .ShortRepoPath | Str2html}}
  2432. + {{else if eq .GetOpType 5}}
  2433. + {{ $branchLink := .GetBranch | EscapePound}}
  2434. + {{$.i18n.Tr "action.commit_repo" .GetRepoLink $branchLink .GetBranch .ShortRepoPath | Str2html}}
  2435. + {{else if eq .GetOpType 6}}
  2436. + {{ $index := index .GetIssueInfos 0}}
  2437. + {{$.i18n.Tr "action.create_issue" .GetRepoLink $index .ShortRepoPath | Str2html}}
  2438. + {{else if eq .GetOpType 7}}
  2439. + {{ $index := index .GetIssueInfos 0}}
  2440. + {{$.i18n.Tr "action.create_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}}
  2441. + {{else if eq .GetOpType 8}}
  2442. + {{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .ShortRepoPath | Str2html}}
  2443. + {{else if eq .GetOpType 9}}
  2444. + {{$.i18n.Tr "action.push_tag" .GetRepoLink .GetBranch .ShortRepoPath | Str2html}}
  2445. + {{else if eq .GetOpType 10}}
  2446. + {{ $index := index .GetIssueInfos 0}}
  2447. + {{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .ShortRepoPath | Str2html}}
  2448. + {{else if eq .GetOpType 11}}
  2449. + {{ $index := index .GetIssueInfos 0}}
  2450. + {{$.i18n.Tr "action.merge_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}}
  2451. + {{else if eq .GetOpType 12}}
  2452. + {{ $index := index .GetIssueInfos 0}}
  2453. + {{$.i18n.Tr "action.close_issue" .GetRepoLink $index .ShortRepoPath | Str2html}}
  2454. + {{else if eq .GetOpType 13}}
  2455. + {{ $index := index .GetIssueInfos 0}}
  2456. + {{$.i18n.Tr "action.reopen_issue" .GetRepoLink $index .ShortRepoPath | Str2html}}
  2457. + {{else if eq .GetOpType 14}}
  2458. + {{ $index := index .GetIssueInfos 0}}
  2459. + {{$.i18n.Tr "action.close_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}}
  2460. + {{else if eq .GetOpType 15}}
  2461. + {{ $index := index .GetIssueInfos 0}}
  2462. + {{$.i18n.Tr "action.reopen_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}}
  2463. + {{end}}
  2464. + </p>
  2465. + {{if eq .GetOpType 5}}
  2466. + <div class="content">
  2467. + <ul>
  2468. + {{ $push := ActionContent2Commits .}}
  2469. + {{ $repoLink := .GetRepoLink}}
  2470. + {{if $push.Commits}}
  2471. + {{range $push.Commits}}
  2472. + <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>
  2473. + {{end}}
  2474. + {{end}}
  2475. + {{if and (gt $push.Len 1) $push.CompareUrl}}<li><a href="{{AppSubUrl}}/{{$push.CompareUrl}}">{{$.i18n.Tr "action.compare_commits" $push.Len}} »</a></li>{{end}}
  2476. + </ul>
  2477. + </div>
  2478. + {{else if eq .GetOpType 6}}
  2479. + <span class="text truncate issue title has-emoji">{{index .GetIssueInfos 1}}</span>
  2480. + {{else if eq .GetOpType 7}}
  2481. + <span class="text truncate issue title has-emoji">{{index .GetIssueInfos 1}}</span>
  2482. + {{else if eq .GetOpType 10}}
  2483. + <span class="text truncate issue title has-emoji">{{.GetIssueTitle}}</span>
  2484. + <p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
  2485. + {{else if eq .GetOpType 11}}
  2486. + <p class="text light grey has-emoji">{{index .GetIssueInfos 1}}</p>
  2487. + {{else if (or (or (eq .GetOpType 12) (eq .GetOpType 13)) (or (eq .GetOpType 14) (eq .GetOpType 15)))}}
  2488. + <span class="text truncate issue title has-emoji">{{.GetIssueTitle}}</span>
  2489. + {{end}}
  2490. + <p class="text italic light grey">{{TimeSince .GetCreate $.i18n.Lang}}</p>
  2491. + </div>
  2492. + </div>
  2493. + <div class="ui one wide column">
  2494. + <i class="text grey mega-octicon octicon-{{ActionIcon .GetOpType}}"></i>
  2495. + </div>
  2496. + </div>
  2497. + <div class="ui divider"></div>
  2498. + </div>
  2499. ++>>>>>>> upstream/master
  2500. {{end}}
  2501. diff --cc templates/user/profile.tmpl
  2502. index 59d8d21,8f68e93..0000000
  2503. --- a/templates/user/profile.tmpl
  2504. +++ b/templates/user/profile.tmpl
  2505. @@@ -1,104 -1,99 +1,204 @@@
  2506. ++<<<<<<< HEAD
  2507. +{{template "ng/base/head" .}}
  2508. +{{template "ng/base/header" .}}
  2509. +<div class="main-wrapper">
  2510. + <div id="user-profile-page" class="container clear">
  2511. + <div class="grid-1-5 left">
  2512. + <div>
  2513. + {{if .Owner.UseCustomAvatar}}
  2514. + <a href="{{AppSubUrl}}/user/settings" id="profile-avatar" original-title="{{.i18n.Tr "user.change_custom_avatar"}}">
  2515. + {{else}}
  2516. + <a href="http://gravatar.com/emails/" id="profile-avatar" original-title="{{.i18n.Tr "user.change_avatar"}}">
  2517. + {{end}}
  2518. + <img class="profile-avatar" src="{{.Owner.AvatarLink}}?s=200"title="{{.Owner.Name}}"/>
  2519. + </a>
  2520. + <div class="text-center" id="profile-name">
  2521. + {{if .Owner.FullName}}<span id="profile-fullname" class="center-block">{{.Owner.FullName}}</span><br>{{end}}
  2522. + <span class="center-block" id="profile-username">{{.Owner.Name}}</span>
  2523. + </div>
  2524. + </div>
  2525. + <div class="profile-info">
  2526. + <hr>
  2527. + <ul class="list-no-style">
  2528. + {{if .Owner.Location}}
  2529. + <li class="list-group-item"><i class="octicon octicon-location"></i>&nbsp;&nbsp;{{.Owner.Location}}</li>
  2530. + {{end}}
  2531. + {{if .Owner.Email}}
  2532. + {{if not .Owner.HideEmail}}
  2533. + <li class="list-group-item"><i class="octicon octicon-mail"></i>&nbsp;&nbsp;<a href="mailto:{{.Owner.Email}}" rel="nofollow">{{.Owner.Email}}</a></li>
  2534. + {{end}}
  2535. + {{end}}
  2536. + {{if .Owner.Website}}
  2537. + <li class="list-group-item"><i class="octicon octicon-link"></i>&nbsp;&nbsp;<a target="_blank" href="{{.Owner.Website}}">{{.Owner.Website}}</a></li>
  2538. + {{end}}
  2539. + <li class="list-group-item"><i class="octicon octicon-clock"></i>&nbsp;&nbsp;{{.i18n.Tr "user.join_on"}} {{DateFmtShort .Owner.Created}}</li>
  2540. + </ul>
  2541. + <hr>
  2542. + <ul class="list-no-style">
  2543. + <li class="list-group-item profile-rel">
  2544. + <a class="text-black" href="">
  2545. + <strong>{{.Owner.NumFollowers}}</strong>
  2546. + <p>{{.i18n.Tr "user.followers"}}</p>
  2547. + </a>
  2548. + </li>
  2549. + <li class="list-group-item profile-rel">
  2550. + <a class="text-black" href="">
  2551. + <strong>{{.Owner.NumStars}}</strong>
  2552. + <p>{{.i18n.Tr "user.starred"}}</p>
  2553. + </a>
  2554. + </li>
  2555. + <li class="list-group-item profile-rel">
  2556. + <a class="text-black" href="">
  2557. + <strong>{{.Owner.NumFollowings}}</strong>
  2558. + <p>{{.i18n.Tr "user.following"}}</p>
  2559. + </a>
  2560. + </li>
  2561. + </ul>
  2562. + <hr>
  2563. + </div>
  2564. + </div>
  2565. + <div class="grid-4-5 left">
  2566. + <div id="profile-body">
  2567. + <ul class="menu menu-line" id="profile-header">
  2568. + <li>
  2569. + <a {{if not .TabName}}class="current"{{end}} href="{{.Owner.HomeLink}}"><i class="octicon octicon-repo"></i> {{.i18n.Tr "user.repositories"}}</a>
  2570. + </li>
  2571. + <li>
  2572. + <a {{if eq .TabName "activity"}}class="current"{{end}} href="{{.Owner.HomeLink}}?tab=activity"><i class="octicon octicon-repo"></i> {{.i18n.Tr "user.activity"}}</a>
  2573. + </li>
  2574. + </ul>
  2575. + <div class="tab-content">
  2576. + {{if eq .TabName "activity"}}
  2577. + <div class="tab-pane active" id="dashboard-news">
  2578. + <br>
  2579. + {{template "user/dashboard/feeds" .}}
  2580. + </div>
  2581. + {{else}}
  2582. + <div class="tab-pane active">
  2583. + <div id="org-repo-list">
  2584. + {{range .Repos}}
  2585. + {{if or (not .IsPrivate) (.HasAccess $.SignedUser)}}
  2586. + <div class="org-repo-item">
  2587. + <ul class="org-repo-status right">
  2588. + <li><i class="octicon octicon-star"></i> {{.NumStars}}</li>
  2589. + <li><i class="octicon octicon-git-branch"></i> {{.NumForks}}</li>
  2590. + </ul>
  2591. + <h2>
  2592. + <a href="{{AppSubUrl}}/{{$.Owner.Name}}/{{.Name}}">{{.Name}}</a>
  2593. + {{if .IsPrivate}}
  2594. + <span class="text-gold"><i class="octicon octicon-lock"></i></span>
  2595. + {{end}}
  2596. + </h2>
  2597. + <p class="org-repo-description">{{.Description}}</p>
  2598. + <p class="org-repo-updated">{{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Updated $.i18n.Lang}}</p>
  2599. + </div>
  2600. + {{end}}
  2601. + {{end}}
  2602. + </div>
  2603. + </div>
  2604. + {{end}}
  2605. + </div>
  2606. + </div>
  2607. + </div>
  2608. + </div>
  2609. ++=======
  2610. + {{template "base/head" .}}
  2611. + <div class="user profile">
  2612. + <div class="ui container">
  2613. + <div class="ui grid">
  2614. + <div class="ui five wide column">
  2615. + <div class="ui card">
  2616. + {{if eq .SignedUserName .Owner.Name}}
  2617. + <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">
  2618. + <img src="{{.Owner.AvatarLink}}?s=290" title="{{.Owner.Name}}"/>
  2619. + </a>
  2620. + {{else}}
  2621. + <span class="image">
  2622. + <img src="{{.Owner.AvatarLink}}?s=290" title="{{.Owner.Name}}"/>
  2623. + </span>
  2624. + {{end}}
  2625. + <div class="content">
  2626. + {{if .Owner.FullName}}<span class="header text center">{{.Owner.FullName}}</span>{{end}}
  2627. + <span class="username text center">{{.Owner.Name}}</span>
  2628. + </div>
  2629. + <div class="extra content">
  2630. + <ul class="text black">
  2631. + {{if .Owner.Location}}
  2632. + <li><i class="octicon octicon-location"></i> {{.Owner.Location}}</li>
  2633. + {{end}}
  2634. + {{if and .Owner.Email .IsSigned}}
  2635. + <li>
  2636. + <i class="octicon octicon-mail"></i>
  2637. + <a href="mailto:{{.Owner.Email}}" rel="nofollow">{{.Owner.Email}}</a>
  2638. + </li>
  2639. + {{end}}
  2640. + {{if .Owner.Website}}
  2641. + <li>
  2642. + <i class="octicon octicon-link"></i>
  2643. + <a target="_blank" href="{{.Owner.Website}}">{{.Owner.Website}}</a>
  2644. + </li>
  2645. + {{end}}
  2646. + <li><i class="octicon octicon-clock"></i> {{.i18n.Tr "user.join_on"}} {{DateFmtShort .Owner.Created}}</li>
  2647. + <li>
  2648. + <i class="octicon octicon-person"></i>
  2649. + <a href="{{.Owner.HomeLink}}/followers">
  2650. + {{.Owner.NumFollowers}} {{.i18n.Tr "user.followers"}}
  2651. + </a>
  2652. + -
  2653. + <a href="{{.Owner.HomeLink}}/following">
  2654. + {{.Owner.NumFollowing}} {{.i18n.Tr "user.following"}}
  2655. + </a>
  2656. + </li>
  2657. + {{/*
  2658. + <li>
  2659. + <i class="octicon octicon-star"></i>
  2660. + <a href="{{.Owner.HomeLink}}/stars">
  2661. + {{.Owner.NumStars}} {{.i18n.Tr "user.starred"}}
  2662. + </a>
  2663. + </li>
  2664. + */}}
  2665. + {{if .Orgs}}
  2666. + <li>
  2667. + {{range .Orgs}}
  2668. + <a href="{{.HomeLink}}"><img class="ui mini image poping up" src="{{.AvatarLink}}" data-content="{{.Name}}" data-position="top center" data-variation="tiny inverted"></a>
  2669. + {{end}}
  2670. + </li>
  2671. + {{end}}
  2672. + {{if and .IsSigned (ne .SignedUserName .Owner.Name)}}
  2673. + <li class="follow">
  2674. + {{if .SignedUser.IsFollowing .Owner.Id}}
  2675. + <a class="ui basic red button" href="{{.Link}}/action/unfollow?redirect_to={{$.Link}}"><i class="octicon octicon-person"></i> {{.i18n.Tr "user.unfollow"}}</a>
  2676. + {{else}}
  2677. + <a class="ui basic green button" href="{{.Link}}/action/follow?redirect_to={{$.Link}}"><i class="octicon octicon-person"></i> {{.i18n.Tr "user.follow"}}</a>
  2678. + {{end}}
  2679. + </li>
  2680. + {{end}}
  2681. + </ul>
  2682. + </div>
  2683. + </div>
  2684. + </div>
  2685. + <div class="ui eleven wide column">
  2686. + <div class="ui secondary pointing menu">
  2687. + <a class="{{if ne .TabName "activity"}}active{{end}} item" href="{{.Owner.HomeLink}}">
  2688. + <i class="octicon octicon-repo"></i> {{.i18n.Tr "user.repositories"}}
  2689. + </a>
  2690. + <a class="item">
  2691. + <a class="{{if eq .TabName "activity"}}active{{end}} item" href="{{.Owner.HomeLink}}?tab=activity">
  2692. + <i class="octicon octicon-rss"></i> {{.i18n.Tr "user.activity"}}
  2693. + </a>
  2694. + </a>
  2695. + </div>
  2696. + {{if ne .TabName "activity"}}
  2697. + {{template "explore/repo_list" .}}
  2698. + {{else}}
  2699. + <br>
  2700. + <div class="feeds">
  2701. + {{template "user/dashboard/feeds" .}}
  2702. + </div>
  2703. + {{end}}
  2704. + </div>
  2705. + </div>
  2706. + </div>
  2707. ++>>>>>>> upstream/master
  2708. </div>
  2709. - {{template "ng/base/footer" .}}
  2710. + {{template "base/footer" .}}
  2711. diff --cc templates/user/settings/profile.tmpl
  2712. index 1e07d89,a1328a2..0000000
  2713. --- a/templates/user/settings/profile.tmpl
  2714. +++ b/templates/user/settings/profile.tmpl
  2715. @@@ -1,86 -1,75 +1,164 @@@
  2716. ++<<<<<<< HEAD
  2717. +{{template "ng/base/head" .}}
  2718. +{{template "ng/base/header" .}}
  2719. +<div id="setting-wrapper" class="main-wrapper">
  2720. + <div id="user-profile-setting" class="container clear">
  2721. + {{template "user/settings/nav" .}}
  2722. + <div class="grid-4-5 left">
  2723. + <div class="setting-content">
  2724. + {{template "ng/base/alert" .}}
  2725. + <div id="setting-content">
  2726. + <div id="user-profile-setting-content" class="panel panel-radius">
  2727. + <div class="panel-header">
  2728. + <strong>{{.i18n.Tr "settings.public_profile"}}</strong>
  2729. + </div>
  2730. + <div class="panel-body">
  2731. + <form class="form form-align" id="user-profile-form" action="{{AppSubUrl}}/user/settings" method="post">
  2732. + {{.CsrfTokenHtml}}
  2733. + <div class="text-center panel-desc">{{.i18n.Tr "settings.profile_desc"}}</div>
  2734. + <div class="field">
  2735. + <label>{{.i18n.Tr "settings.uid"}}</label>
  2736. + <label class="text-left">{{.SignedUser.Id}}</label>
  2737. + </div>
  2738. + <div class="field">
  2739. + <label class="req" for="username">{{.i18n.Tr "username"}}</label>
  2740. + <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 />
  2741. + </div>
  2742. + <div class="white-popup-block mfp-hide" id="change-username-modal">
  2743. + <h1 class="text-red">{{.i18n.Tr "settings.change_username"}}</h1>
  2744. + <p>{{.i18n.Tr "settings.change_username_desc"}}</p>
  2745. + <br>
  2746. + <button class="btn btn-red btn-large btn-radius" id="change-username-submit">{{.i18n.Tr "settings.continue"}}</button>
  2747. + <button class="btn btn-large btn-radius popup-modal-dismiss">{{.i18n.Tr "settings.cancel"}}</button>
  2748. + </div>
  2749. + <div class="field">
  2750. + <label for="full-name">{{.i18n.Tr "settings.full_name"}}</label>
  2751. + <input class="ipt ipt-large ipt-radius {{if .Err_FullName}}ipt-error{{end}}" id="full-name" name="fullname" type="text" value="{{.SignedUser.FullName}}" />
  2752. + </div>
  2753. + <div class="field">
  2754. + <label class="req" for="email">{{.i18n.Tr "email"}}</label>
  2755. + <input class="ipt ipt-large ipt-radius {{if .Err_Email}}ipt-error{{end}}" id="email" name="email" type="email" value="{{.SignedUser.Email}}" required />
  2756. + </div>
  2757. + <div class="field">
  2758. + <label for="hideemail">Hide E-mail address</label>
  2759. + <input class="ipt-chk" id="hideemail" name="hideemail" type="checkbox" {{if .SignedUser.HideEmail}}checked{{end}} />
  2760. + </div>
  2761. + <div class="field">
  2762. + <label for="website">{{.i18n.Tr "settings.website"}}</label>
  2763. + <input class="ipt ipt-large ipt-radius {{if .Err_Website}}ipt-error{{end}}" id="website" name="website" type="url" value="{{.SignedUser.Website}}" />
  2764. + </div>
  2765. + <div class="field">
  2766. + <label for="location">{{.i18n.Tr "settings.location"}}</label>
  2767. + <input class="ipt ipt-large ipt-radius {{if .Err_Location}}ipt-error{{end}}" id="location" name="location" type="text" value="{{.SignedUser.Location}}" />
  2768. + </div>
  2769. + <div class="field {{if DisableGravatar}}hide{{end}}">
  2770. + <label class="req" for="gravatar-email">Gravatar {{.i18n.Tr "email"}}</label>
  2771. + <input class="ipt ipt-large ipt-radius {{if .Err_Avatar}}ipt-error{{end}}" id="gravatar-email" name="avatar" type="text" value="{{.SignedUser.AvatarEmail}}" />
  2772. + </div>
  2773. + <div class="field">
  2774. + <label></label>
  2775. + <button class="btn btn-green btn-large btn-radius" id="change-username-btn" href="#change-username-modal">{{.i18n.Tr "settings.update_profile"}}</button>
  2776. + </div>
  2777. + </form>
  2778. + <hr>
  2779. + <form class="form form-align" id="user-profile-form" action="{{AppSubUrl}}/user/settings/avatar" method="post" enctype="multipart/form-data">
  2780. + {{.CsrfTokenHtml}}
  2781. + <div class="field">
  2782. + <label for="enable">{{.i18n.Tr "settings.enable_custom_avatar"}}</label>
  2783. + <input class="ipt-chk" id="enable" name="enable" type="checkbox" {{if .SignedUser.UseCustomAvatar}}checked{{end}} />
  2784. + <span>{{.i18n.Tr "settings.enable_custom_avatar_helper"}}</span>
  2785. + </div>
  2786. + <div class="field">
  2787. + <label>{{.i18n.Tr "settings.choose_new_avatar"}}</label>
  2788. + <input name="avatar" type="file" />
  2789. + </div>
  2790. + <div class="field">
  2791. + <label></label>
  2792. + <button class="btn btn-green btn-large btn-radius">{{.i18n.Tr "settings.update_avatar"}}</button>
  2793. + </div>
  2794. + </form>
  2795. + </div>
  2796. + </div>
  2797. + </div>
  2798. + </div>
  2799. + </div>
  2800. + </div>
  2801. +</div>
  2802. +{{template "ng/base/footer" .}}
  2803. ++=======
  2804. + {{template "base/head" .}}
  2805. + <div class="user settings profile">
  2806. + <div class="ui container">
  2807. + <div class="ui grid">
  2808. + {{template "user/settings/navbar" .}}
  2809. + <div class="twelve wide column content">
  2810. + {{template "base/alert" .}}
  2811. + <h4 class="ui top attached header">
  2812. + {{.i18n.Tr "settings.public_profile"}}
  2813. + </h4>
  2814. + <div class="ui attached segment">
  2815. + <p>{{.i18n.Tr "settings.profile_desc"}}</p>
  2816. + <form class="ui form" action="{{.Link}}" method="post">
  2817. + {{.CsrfTokenHtml}}
  2818. + <div class="required field {{if .Err_Name}}error{{end}}">
  2819. + <label for="username">{{.i18n.Tr "username"}}<span class="text red hide" id="name-change-prompt"> {{.i18n.Tr "settings.change_username_prompt"}}</span></label>
  2820. + <input id="username" name="name" value="{{.SignedUser.Name}}" data-name="{{.SignedUser.Name}}" autofocus required {{if not .SignedUser.IsLocal}}disabled{{end}}>
  2821. + {{if not .SignedUser.IsLocal}}
  2822. + <p class="help text blue">{{$.i18n.Tr "settings.password_username_disabled"}}</p>
  2823. + {{end}}
  2824. + </div>
  2825. + <div class="field {{if .Err_FullName}}error{{end}}">
  2826. + <label for="full_name">{{.i18n.Tr "settings.full_name"}}</label>
  2827. + <input id="full_name" name="full_name" value="{{.SignedUser.FullName}}">
  2828. + </div>
  2829. + <div class="required field {{if .Err_Email}}error{{end}}">
  2830. + <label for="email">{{.i18n.Tr "email"}}</label>
  2831. + <input id="email" name="email" value="{{.SignedUser.Email}}">
  2832. + </div>
  2833. + <div class="field {{if .Err_Website}}error{{end}}">
  2834. + <label for="website">{{.i18n.Tr "settings.website"}}</label>
  2835. + <input id="website" name="website" type="url" value="{{.SignedUser.Website}}">
  2836. + </div>
  2837. + <div class="field">
  2838. + <label for="location">{{.i18n.Tr "settings.location"}}</label>
  2839. + <input id="location" name="location" value="{{.SignedUser.Location}}">
  2840. + </div>
  2841. + {{if not DisableGravatar}}
  2842. + <div class="field {{if .Err_Gravatar}}error{{end}}">
  2843. + <label for="gravatar">Gravatar {{.i18n.Tr "email"}}</label>
  2844. + <input id="gravatar" name="gravatar" value="{{.SignedUser.AvatarEmail}}" />
  2845. + </div>
  2846. + {{end}}
  2847. +
  2848. + <div class="field">
  2849. + <button class="ui green button">{{$.i18n.Tr "settings.update_profile"}}</button>
  2850. + </div>
  2851. + </form>
  2852. +
  2853. + <div class="ui divider"></div>
  2854. +
  2855. + <form class="ui form" action="{{.Link}}/avatar" method="post" enctype="multipart/form-data">
  2856. + {{.CsrfTokenHtml}}
  2857. + <div class="inline field">
  2858. + <div class="ui checkbox">
  2859. + <input name="enable" type="checkbox" {{if .SignedUser.UseCustomAvatar}}checked{{end}}>
  2860. + <label>{{.i18n.Tr "settings.enable_custom_avatar"}}</label>
  2861. + </div>
  2862. + </div>
  2863. + <div class="inline field">
  2864. + <label for="avatar">{{.i18n.Tr "settings.choose_new_avatar"}}</label>
  2865. + <input name="avatar" type="file" >
  2866. + </div>
  2867. +
  2868. + <div class="field">
  2869. + <button class="ui green button">{{$.i18n.Tr "settings.update_avatar"}}</button>
  2870. + <a class="ui red button delete-post" data-request-url="{{.Link}}/avatar/delete" data-done-url="{{.Link}}">{{$.i18n.Tr "settings.delete_current_avatar"}}</a>
  2871. + </div>
  2872. + </form>
  2873. + </div>
  2874. + </div>
  2875. + </div>
  2876. + </div>
  2877. + </div>
  2878. + {{template "base/footer" .}}
  2879. ++>>>>>>> upstream/master
  2880. * Unmerged path modules/base/template.go
  2881. * Unmerged path modules/git/commit.go
  2882. * Unmerged path routers/api/v1/repo.go
  2883. * Unmerged path routers/api/v1/repo_hooks.go
  2884. * Unmerged path routers/api/v1/user.go
  2885. * Unmerged path templates/ng/base/footer.tmpl
  2886. * Unmerged path templates/ng/base/head.tmpl
  2887. * Unmerged path templates/ng/base/header.tmpl