UI: create issue with title and content

This commit is contained in:
Unknwon committed 2015-08-09 15:23:02 +08:00
1 parent 43a87b0caf
commit 590c464c56
18 files changed
+971 -174

No files matched your search

+2 -2
View File
@@ -419,8 +419,8 @@ func runWeb(ctx *cli.Context) {
m.Get("/action/:action", repo.Action)
m.Group("/issues", func() {
m.Get("/new", repo.CreateIssue)
m.Post("/new", bindIgnErr(auth.CreateIssueForm{}), repo.CreateIssuePost)
m.Combo("/new").Get(repo.NewIssue).
Post(bindIgnErr(auth.CreateIssueForm{}), repo.NewIssuePost)
m.Post("/:index", bindIgnErr(auth.CreateIssueForm{}), repo.UpdateIssue)
m.Post("/:index/label", repo.UpdateIssueLabel)
m.Post("/:index/milestone", repo.UpdateIssueMilestone)
+1
View File
@@ -367,6 +367,7 @@ commits.older = Older
commits.newer = Newer
issues.new = New Issue
issues.create = Create Issue
issues.new_label = New Label
issues.new_label_placeholder = Label name...
issues.open_tab = %d Open
+20
View File
@@ -388,6 +388,26 @@
"strictMath": 0,
"strictUnits": 0
},
"\/public\/less\/_markdown.less": {
"allowInsecureImports": 0,
"createSourceMap": 0,
"disableJavascript": 0,
"fileType": 1,
"ieCompatibility": 1,
"ignore": 1,
"ignoreWasSetByUser": 0,
"inputAbbreviatedPath": "\/public\/less\/_markdown.less",
"outputAbbreviatedPath": "\/public\/css\/_markdown.css",
"outputPathIsOutsideProject": 0,
"outputPathIsSetByUser": 0,
"outputStyle": 0,
"relativeURLS": 0,
"shouldRunAutoprefixer": 0,
"shouldRunBless": 0,
"strictImports": 0,
"strictMath": 0,
"strictUnits": 0
},
"\/public\/less\/_octicons.less": {
"allowInsecureImports": 0,
"createSourceMap": 0,
+1 -1
View File
@@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting"
)
const APP_VER = "0.6.4.0808 Beta"
const APP_VER = "0.6.4.0809 Beta"
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
+13 -13
View File
@@ -38,7 +38,7 @@ type Issue struct {
Repo *Repository `xorm:"-"`
PosterID int64
Poster *User `xorm:"-"`
LabelIds string `xorm:"TEXT"`
LabelIDs string `xorm:"label_ids TEXT"`
Labels []*Label `xorm:"-"`
MilestoneID int64
Milestone *Milestone `xorm:"-"`
@@ -77,11 +77,11 @@ func (i *Issue) GetPoster() (err error) {
}
func (i *Issue) GetLabels() error {
if len(i.LabelIds) < 3 {
if len(i.LabelIDs) < 3 {
return nil
}
strIds := strings.Split(strings.TrimSuffix(i.LabelIds[1:], "|"), "|$")
strIds := strings.Split(strings.TrimSuffix(i.LabelIDs[1:], "|"), "|$")
i.Labels = make([]*Label, 0, len(strIds))
for _, strId := range strIds {
id := com.StrTo(strId).MustInt64()
@@ -134,7 +134,7 @@ func NewIssue(issue *Issue) (err error) {
if _, err = sess.Insert(issue); err != nil {
return err
} else if _, err = sess.Exec("UPDATE `repository` SET num_issues = num_issues + 1 WHERE id = ?", issue.RepoID); err != nil {
} else if _, err = sess.Exec("UPDATE `repository` SET num_issues=num_issues+1 WHERE id=?", issue.RepoID); err != nil {
return err
}
@@ -296,14 +296,14 @@ type IssueUser struct {
// FIXME: organization
// NewIssueUserPairs adds new issue-user pairs for new issue of repository.
func NewIssueUserPairs(repo *Repository, issueID, orgID, posterID, assigneeID int64) error {
func NewIssueUserPairs(repo *Repository, issue *Issue) error {
users, err := repo.GetCollaborators()
if err != nil {
return err
}
iu := &IssueUser{
IssueId: issueID,
IssueId: issue.ID,
RepoId: repo.ID,
}
@@ -311,30 +311,30 @@ func NewIssueUserPairs(repo *Repository, issueID, orgID, posterID, assigneeID in
for _, u := range users {
iu.Id = 0
iu.Uid = u.Id
iu.IsPoster = iu.Uid == posterID
iu.IsPoster = iu.Uid == issue.PosterID
if isNeedAddPoster && iu.IsPoster {
isNeedAddPoster = false
}
iu.IsAssigned = iu.Uid == assigneeID
iu.IsAssigned = iu.Uid == issue.AssigneeID
if _, err = x.Insert(iu); err != nil {
return err
}
}
if isNeedAddPoster {
iu.Id = 0
iu.Uid = posterID
iu.Uid = issue.PosterID
iu.IsPoster = true
iu.IsAssigned = iu.Uid == assigneeID
iu.IsAssigned = iu.Uid == issue.AssigneeID
if _, err = x.Insert(iu); err != nil {
return err
}
}
// Add owner's as well.
if repo.OwnerID != posterID {
if repo.OwnerID != issue.PosterID {
iu.Id = 0
iu.Uid = repo.OwnerID
iu.IsAssigned = iu.Uid == assigneeID
iu.IsAssigned = iu.Uid == issue.AssigneeID
if _, err = x.Insert(iu); err != nil {
return err
}
@@ -621,7 +621,7 @@ func DeleteLabel(repoID, labelID int64) error {
}
for _, issue := range issues {
issue.LabelIds = strings.Replace(issue.LabelIds, "$"+com.ToStr(labelID)+"|", "", -1)
issue.LabelIDs = strings.Replace(issue.LabelIDs, "$"+com.ToStr(labelID)+"|", "", -1)
if _, err = sess.Id(issue.ID).AllCols().Update(issue); err != nil {
return err
}
+3 -3
View File
@@ -14,9 +14,9 @@ import (
)
type MarkdownForm struct {
Text string `form:"text"`
Mode string `form:"mode"`
Context string `form:"context"`
Text string
Mode string
Context string
}
func (f *MarkdownForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
+5 -5
View File
@@ -98,11 +98,11 @@ func (f *NewSlackHookForm) Validate(ctx *macaron.Context, errs binding.Errors) b
// \/ \/ \/
type CreateIssueForm struct {
IssueName string `form:"title" binding:"Required;MaxSize(255)"`
MilestoneId int64 `form:"milestoneid"`
AssigneeId int64 `form:"assigneeid"`
Labels string `form:"labels"`
Content string `form:"content"`
Title string `binding:"Required;MaxSize(255)"`
LabelIDs []int64 `form:"label_id"`
MilestoneID int64
AssigneeID int64
Content string
}
func (f *CreateIssueForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
+3 -3
View File
@@ -772,7 +772,7 @@ func confLocaleLocale_deDeIni() (*asset, error) {
return a, nil
}
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\x7d\xeb\x72\xdc\x46\xb2\xe6\x7f\x3c\x05\xac\x0d\xad\xec\x08\xaa\x15\xb6\x63\x2f\xe1\x90\xe4\xa5\x49\xeb\x32\x47\x14\x75\x44\x6a\x66\x67\x15\x0a\x0c\xba\x01\x76\x63\xd4\x0d\xb4\x71\x61\x9b\xf3\x6b\x5f\x63\x5f\x6f\x9f\x64\x33\xbf\xcc\xac\x0b\x80\xa6\xe4\x39\x27\xf6\xfc\x21\xab\xab\xb2\x6e\x59\x59\x59\x79\xab\x42\xbe\xdf\x67\x45\xd9\xad\xd2\x67\xe9\x69\xba\xcf\xab\x7a\x5b\x76\x5d\xda\x95\xdb\x9b\xc7\x9b\xa6\xeb\xcb\x22\x7d\x59\xf5\xf4\xbb\xbd\xad\x56\x65\x92\x6c\x9a\x5d\x49\xa0\xaf\xe8\x5f\x52\xe4\xdd\x66\xd9\xe4\x6d\x41\x19\xe7\x96\x4e\xca\xdf\xf7\xdb\xa6\x65\xa0\x5f\x25\x95\x6c\xca\xed\x9e\xeb\xd0\xbf\xa4\xab\xd6\x75\x56\xd5\xf4\xf3\x8a\x52\xe9\xeb\x3a\xe9\x9a\x55\x95\x6f\xb3\xa0\x00\x19\x56\xfe\x53\xfa\x43\x5d\xa4\x57\x7d\xb9\x4f\x9f\x76\xbb\x7c\xbb\x7d\x9e\x77\xa8\xd2\x97\x69\xbe\x5a\x35\x43\xdd\x3f\x7d\x22\x05\xd2\x78\x33\xf4\xd6\xfa\xe5\xd0\x4b\xde\xb0\xb7\xac\x0f\xfb\xa4\x2d\xd7\x15\x4d\xac\xa5\xac\xf7\x9a\x4c\x0e\xe5\xb2\xab\x7a\x1e\xf4\x5f\x24\x95\xdc\x96\x6d\x57\x35\x3c\x9e\x3f\x4b\x2a\xd9\xe7\x6b\x06\x78\x47\xff\x92\xbe\xdc\xed\xb7\x39\x2a\x5c\x6b\x32\xd9\xe6\xf5\x7a\x10\x98\x37\x9a\x4c\x92\x81\x30\x57\xe7\xc0\xd9\x07\x4d\x26\xe5\x2e\xaf\xb6\x8c\x9f\xc7\x9c\xa0\x76\xbb\xee\xd0\x00\x8b\xef\x34\x49\x63\xcc\xfa\xbb\x7d\x89\x21\x3e\xbe\xa6\x54\xb2\xca\xf7\xfd\x6a\x93\x53\xce\x99\xa4\x12\x02\xda\x37\x34\xd6\xa6\xbd\x03\x9c\xfd\x48\x9a\x76\x9d\xd7\xd5\x3f\xf2\x5e\xc6\x7f\x19\xfc\x4c\x76\x55\xdb\x36\x3c\xf5\x0b\x24\x92\xba\x3c\x64\xdc\x0e\xe5\xbc\x2d\x0f\x61\x2b\x5c\xb2\xab\xd6\xad\xcc\x92\x0b\x2f\xf0\x8b\x5b\xe1\xb2\x9b\xa6\xfd\xac\x05\x2f\x38\x39\xaa\x4a\x83\xd0\xd2\xb8\xff\xbc\x26\xbc\x68\xe9\x05\x7e\x44\x00\x5d\x92\x17\xbb\xaa\xce\xf6\x79\x5d\x32\x8e\x4e\xf9\x17\xe1\x85\x7e\x25\xba\xdc\x59\x57\xf6\x7d\x55\xaf\x3b\x2e\x96\xac\xf4\x4a\xb3\x92\xa0\xcc\xe5\xf1\x78\xba\xec\xa6\x2c\x0b\x19\x51\x97\xbe\xa0\x74\xb2\x1f\xb6\x5b\x9a\xfb\x6f\x43\xd9\xf5\x0c\xff\x8e\x7e\xd3\x2c\xe4\x77\x52\x75\x1d\x25\x28\xfb\x35\x12\x09\x2d\x40\xbd\xc2\x90\xce\x90\x48\x92\x8f\x5d\x99\xb7\xab\xcd\xa7\x44\xfe\xa3\x47\x4e\x2c\x16\x8b\xa3\x4b\xc3\xe4\xa0\xa4\x20\x3d\x58\x07\xc9\xaa\x29\xf8\xc7\x19\xfd\xa3\xa6\xab\xba\xeb\x89\xa4\x3f\x25\x9a\x60\x30\x49\x09\x1a\xfb\xaa\xdf\x96\x3e\x13\xfb\xa3\xe3\x75\x48\x5f\x54\x6d\xd7\x3f\xee\x2b\x22\xb9\xf7\x43\x9d\xf0\xfc\x88\x9c\xb3\x62\x69\xbb\xfc\x65\x43\xd8\x41\x76\x4b\xf3\xbb\xb8\xbb\xfa\xd7\x37\x27\xe9\x3b\xda\xea\xeb\xb6\xa4\x74\x4a\x6d\xd0\x3f\xaa\xf3\xe3\x22\xa1\x5a\xd6\xd3\x79\xde\xe7\xcb\xbc\x2b\x3d\x5a\xb9\x50\x68\xd4\x95\x81\x52\x99\x6d\x80\x45\x74\x7d\x34\xdf\x39\x3a\xa7\x36\x74\x77\xb8\x36\xde\xf2\x16\xa1\x7c\xe6\x1a\xa8\xfc\x6e\x5b\x72\x3e\x35\x95\xbe\x7e\xfb\xf6\xf2\xfc\x97\xb4\xac\xd7\x55\x5d\xa6\x87\xaa\xdf\xa4\x43\x7f\xf3\xdf\xb3\x75\x59\x97\x2d\x31\x91\x55\x95\xd2\xce\x68\x89\x08\x52\x22\x4f\x99\xdc\x22\xe9\xba\x6d\xb6\x13\xf4\x5e\x5d\xbd\x49\x2f\x18\xc5\xfb\xbc\xdf\x60\x20\xfd\x26\xe9\x7e\xdb\x32\x8a\x5c\x87\xd7\x9b\x32\xbd\xa9\x68\xd6\x00\x6a\x6e\x0c\x1f\x69\xa1\x63\x5c\x24\x65\xdb\x66\xb4\xef\xfb\xbb\x4c\x2b\x6b\x7b\x63\x48\x69\x82\x48\xa7\x6e\xfa\x74\x59\xa6\xa8\xb3\x48\x12\x1b\xb0\x61\xf7\x74\xbf\xdf\x56\x2b\xd9\xb1\x2f\xa5\xcc\x23\x9a\x59\xb4\x62\x29\x84\x03\xa2\xac\x2c\x40\x17\xf1\xbf\xbb\x66\x68\xd3\x88\x0d\xa0\xfe\xa6\x24\xbe\xbc\x19\x68\xcb\xe5\xc4\x53\xb7\xcd\x50\x7c\x03\x4a\xb5\xd1\x7b\x42\x4d\xdf\x37\x34\x60\x60\xc7\x01\xf8\x2e\x4e\x89\xe2\xf8\x54\x68\xcb\x5d\x43\xdc\xc1\x11\x7b\x45\x04\x75\xa8\xa8\x90\x66\xda\xe5\xb7\xb4\xdf\xfa\x26\xed\x37\x55\x97\x16\x44\x6c\x2b\x6e\x98\xb6\xc6\x40\xfc\x58\xc8\x82\x08\x54\x48\xc3\xf2\xe2\x35\x00\xd4\x6e\x20\x6a\xda\x50\x63\xcc\xed\xf9\x68\xa2\x26\xe7\xc6\x89\x29\x51\x3b\xa0\x6f\xa2\xdc\x86\x78\x2b\x73\xbf\x73\x24\xf4\x77\xd8\x3e\x8d\x2a\xbf\xb9\xa1\x51\x75\x44\x15\xaf\xd2\xd5\xb6\x21\x92\xfa\xf0\xfe\x0d\x55\xde\xf4\xfd\x3e\xdb\x37\x2d\xc8\xf8\xfa\xfa\x1d\x6d\x8f\xb6\xf7\xb9\x01\xae\x19\xa6\x1e\x76\x4b\xfa\x75\xd8\x54\xc4\x04\xf2\x60\x81\x80\x8a\x2d\x1f\x30\x75\xda\xd4\x0b\xac\xd5\xd0\x6e\x47\xcb\x48\x5d\x5a\xc9\x91\xe1\xf1\x10\x9e\xf0\x9f\x2b\x3f\x4a\x4c\xb7\xa3\x53\xf8\x80\x45\xa5\xa9\x96\x38\x4d\x88\xb6\x9a\x3d\xb7\x1b\x10\xd7\xa5\x66\x78\x8a\xc2\x09\xe4\xca\xe5\x1c\xa2\x52\x9c\xf1\x01\x2f\xdd\xd1\x84\x75\x37\x5f\x5d\x10\x1a\xb0\xa5\x91\x7b\xd3\x36\x3b\xca\x7d\x41\xff\x7c\x86\x1f\xfe\x05\xb7\x07\x98\xbc\x28\x88\xcd\x74\x27\xe9\xfb\x17\x67\xe9\x7f\xf9\xf1\x87\x1f\x16\xe9\xeb\x9e\x37\x04\xd3\xc8\xdf\x79\x6d\x29\x29\x07\xa2\x03\xa5\x9d\xdb\xd3\xf2\x3f\x60\x02\x7f\x90\x3e\x45\xe9\xff\x28\x7f\xcf\xe9\x9c\x2d\x17\xab\x66\xf7\x9c\x37\xf7\x2e\xef\x17\x09\x97\x10\xd5\x28\x39\x5d\x95\x75\x41\x09\x3d\x56\xb5\x2c\xe0\x3a\x5a\x1e\x1c\xb2\x72\xfa\x67\xab\xa6\xbe\xa9\x5a\x9e\xd0\xaf\x75\xbe\x24\x9c\x98\x5c\x40\xec\x18\x25\x76\x76\x11\xd2\x68\x23\x57\x37\x77\x1e\x14\x53\x7d\xcb\x99\xba\xa0\x09\xcb\x4a\xd4\xa8\x8a\x4c\x0e\xcb\x57\xc8\xc6\xba\x5d\xd2\xf4\x5a\xc3\x77\xe7\x11\xde\xdc\xdc\x6c\x89\xb1\x19\xb3\xd2\x1e\x2e\x25\x57\xf8\x56\x08\x42\xc4\xb8\x87\x64\x7Line truncated
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\x7d\xeb\x72\xdc\x46\xb2\xe6\x7f\x3c\x05\xac\x0d\xad\xec\x08\xaa\x15\xb6\x63\x2f\xe1\x90\xe4\xa5\x49\xeb\x32\x47\x14\x75\x44\x6a\x66\x67\x15\x0a\x0c\xba\x01\x76\x63\xd4\x0d\xb4\x71\x61\x9b\xf3\x6b\x5f\x63\x5f\x6f\x9f\x64\x33\xbf\xcc\xac\x0b\x80\xa6\xe4\x39\x27\xf6\xfc\x21\xab\xab\xb2\x6e\x59\x59\x59\x79\xab\x42\xbe\xdf\x67\x45\xd9\xad\xd2\x67\xe9\x69\xba\xcf\xab\x7a\x5b\x76\x5d\xda\x95\xdb\x9b\xc7\x9b\xa6\xeb\xcb\x22\x7d\x59\xf5\xf4\xbb\xbd\xad\x56\x65\x92\x6c\x9a\x5d\x49\xa0\xaf\xe8\x5f\x52\xe4\xdd\x66\xd9\xe4\x6d\x41\x19\xe7\x96\x4e\xca\xdf\xf7\xdb\xa6\x65\xa0\x5f\x25\x95\x6c\xca\xed\x9e\xeb\xd0\xbf\xa4\xab\xd6\x75\x56\xd5\xf4\xf3\x8a\x52\xe9\xeb\x3a\xe9\x9a\x55\x95\x6f\xb3\xa0\x00\x19\x56\xfe\x53\xfa\x43\x5d\xa4\x57\x7d\xb9\x4f\x9f\x76\xbb\x7c\xbb\x7d\x9e\x77\xa8\xd2\x97\x69\xbe\x5a\x35\x43\xdd\x3f\x7d\x22\x05\xd2\x78\x33\xf4\xd6\xfa\xe5\xd0\x4b\xde\xb0\xb7\xac\x0f\xfb\xa4\x2d\xd7\x15\x4d\xac\xa5\xac\xf7\x9a\x4c\x0e\xe5\xb2\xab\x7a\x1e\xf4\x5f\x24\x95\xdc\x96\x6d\x57\x35\x3c\x9e\x3f\x4b\x2a\xd9\xe7\x6b\x06\x78\x47\xff\x92\xbe\xdc\xed\xb7\x39\x2a\x5c\x6b\x32\xd9\xe6\xf5\x7a\x10\x98\x37\x9a\x4c\x92\x81\x30\x57\xe7\xc0\xd9\x07\x4d\x26\xe5\x2e\xaf\xb6\x8c\x9f\xc7\x9c\xa0\x76\xbb\xee\xd0\x00\x8b\xef\x34\x49\x63\xcc\xfa\xbb\x7d\x89\x21\x3e\xbe\xa6\x54\xb2\xca\xf7\xfd\x6a\x93\x53\xce\x99\xa4\x12\x02\xda\x37\x34\xd6\xa6\xbd\x03\x9c\xfd\x48\x9a\x76\x9d\xd7\xd5\x3f\xf2\x5e\xc6\x7f\x19\xfc\x4c\x76\x55\xdb\x36\x3c\xf5\x0b\x24\x92\xba\x3c\x64\xdc\x0e\xe5\xbc\x2d\x0f\x61\x2b\x5c\xb2\xab\xd6\xad\xcc\x92\x0b\x2f\xf0\x8b\x5b\xe1\xb2\x9b\xa6\xfd\xac\x05\x2f\x38\x39\xaa\x4a\x83\xd0\xd2\xb8\xff\xbc\x26\xbc\x68\xe9\x05\x7e\x44\x00\x5d\x92\x17\xbb\xaa\xce\xf6\x79\x5d\x32\x8e\x4e\xf9\x17\xe1\x85\x7e\x25\xba\xdc\x59\x57\xf6\x7d\x55\xaf\x3b\x2e\x96\xac\xf4\x4a\xb3\x92\xa0\xcc\xe5\xf1\x78\xba\xec\xa6\x2c\x0b\x19\x51\x97\xbe\xa0\x74\xb2\x1f\xb6\x5b\x9a\xfb\x6f\x43\xd9\xf5\x0c\xff\x8e\x7e\xd3\x2c\xe4\x77\x52\x75\x1d\x25\x28\xfb\x35\x12\x09\x2d\x40\xbd\xc2\x90\xce\x90\x48\x92\x8f\x5d\x99\xb7\xab\xcd\xa7\x44\xfe\xa3\x47\x4e\x2c\x16\x8b\xa3\x4b\xc3\xe4\xa0\xa4\x20\x3d\x58\x07\xc9\xaa\x29\xf8\xc7\x19\xfd\xa3\xa6\xab\xba\xeb\x89\xa4\x3f\x25\x9a\x60\x30\x49\x09\x1a\xfb\xaa\xdf\x96\x3e\x13\xfb\xa3\xe3\x75\x48\x5f\x54\x6d\xd7\x3f\xee\x2b\x22\xb9\xf7\x43\x9d\xf0\xfc\x88\x9c\xb3\x62\x69\xbb\xfc\x65\x43\xd8\x41\x76\x4b\xf3\xbb\xb8\xbb\xfa\xd7\x37\x27\xe9\x3b\xda\xea\xeb\xb6\xa4\x74\x4a\x6d\xd0\x3f\xaa\xf3\xe3\x22\xa1\x5a\xd6\xd3\x79\xde\xe7\xcb\xbc\x2b\x3d\x5a\xb9\x50\x68\xd4\x95\x81\x52\x99\x6d\x80\x45\x74\x7d\x34\xdf\x39\x3a\xa7\x36\x74\x77\xb8\x36\xde\xf2\x16\xa1\x7c\xe6\x1a\xa8\xfc\x6e\x5b\x72\x3e\x35\x95\xbe\x7e\xfb\xf6\xf2\xfc\x97\xb4\xac\xd7\x55\x5d\xa6\x87\xaa\xdf\xa4\x43\x7f\xf3\xdf\xb3\x75\x59\x97\x2d\x31\x91\x55\x95\xd2\xce\x68\x89\x08\x52\x22\x4f\x99\xdc\x22\xe9\xba\x6d\xb6\x13\xf4\x5e\x5d\xbd\x49\x2f\x18\xc5\xfb\xbc\xdf\x60\x20\xfd\x26\xe9\x7e\xdb\x32\x8a\x5c\x87\xd7\x9b\x32\xbd\xa9\x68\xd6\x00\x6a\x6e\x0c\x1f\x69\xa1\x63\x5c\x24\x65\xdb\x66\xb4\xef\xfb\xbb\x4c\x2b\x6b\x7b\x63\x48\x69\x82\x48\xa7\x6e\xfa\x74\x59\xa6\xa8\xb3\x48\x12\x1b\xb0\x61\xf7\x74\xbf\xdf\x56\x2b\xd9\xb1\x2f\xa5\xcc\x23\x9a\x59\xb4\x62\x29\x84\x03\xa2\xac\x2c\x40\x17\xf1\xbf\xbb\x66\x68\xd3\x88\x0d\xa0\xfe\xa6\x24\xbe\xbc\x19\x68\xcb\xe5\xc4\x53\xb7\xcd\x50\x7c\x03\x4a\xb5\xd1\x7b\x42\x4d\xdf\x37\x34\x60\x60\xc7\x01\xf8\x2e\x4e\x89\xe2\xf8\x54\x68\xcb\x5d\x43\xdc\xc1\x11\x7b\x45\x04\x75\xa8\xa8\x90\x66\xda\xe5\xb7\xb4\xdf\xfa\x26\xed\x37\x55\x97\x16\x44\x6c\x2b\x6e\x98\xb6\xc6\x40\xfc\x58\xc8\x82\x08\x54\x48\xc3\xf2\xe2\x35\x00\xd4\x6e\x20\x6a\xda\x50\x63\xcc\xed\xf9\x68\xa2\x26\xe7\xc6\x89\x29\x51\x3b\xa0\x6f\xa2\xdc\x86\x78\x2b\x73\xbf\x73\x24\xf4\x77\xd8\x3e\x8d\x2a\xbf\xb9\xa1\x51\x75\x44\x15\xaf\xd2\xd5\xb6\x21\x92\xfa\xf0\xfe\x0d\x55\xde\xf4\xfd\x3e\xdb\x37\x2d\xc8\xf8\xfa\xfa\x1d\x6d\x8f\xb6\xf7\xb9\x01\xae\x19\xa6\x1e\x76\x4b\xfa\x75\xd8\x54\xc4\x04\xf2\x60\x81\x80\x8a\x2d\x1f\x30\x75\xda\xd4\x0b\xac\xd5\xd0\x6e\x47\xcb\x48\x5d\x5a\xc9\x91\xe1\xf1\x10\x9e\xf0\x9f\x2b\x3f\x4a\x4c\xb7\xa3\x53\xf8\x80\x45\xa5\xa9\x96\x38\x4d\x88\xb6\x9a\x3d\xb7\x1b\x10\xd7\xa5\x66\x78\x8a\xc2\x09\xe4\xca\xe5\x1c\xa2\x52\x9c\xf1\x01\x2f\xdd\xd1\x84\x75\x37\x5f\x5d\x10\x1a\xb0\xa5\x91\x7b\xd3\x36\x3b\xca\x7d\x41\xff\x7c\x86\x1f\xfe\x05\xb7\x07\x98\xbc\x28\x88\xcd\x74\x27\xe9\xfb\x17\x67\xe9\x7f\xf9\xf1\x87\x1f\x16\xe9\xeb\x9e\x37\x04\xd3\xc8\xdf\x79\x6d\x29\x29\x07\xa2\x03\xa5\x9d\xdb\xd3\xf2\x3f\x60\x02\x7f\x90\x3e\x45\xe9\xff\x28\x7f\xcf\xe9\x9c\x2d\x17\xab\x66\xf7\x9c\x37\xf7\x2e\xef\x17\x09\x97\x10\xd5\x28\x39\x5d\x95\x75\x41\x09\x3d\x56\xb5\x2c\xe0\x3a\x5a\x1e\x1c\xb2\x72\xfa\x67\xab\xa6\xbe\xa9\x5a\x9e\xd0\xaf\x75\xbe\x24\x9c\x98\x5c\x40\xec\x18\x25\x76\x76\x11\xd2\x68\x23\x57\x37\x77\x1e\x14\x53\x7d\xcb\x99\xba\xa0\x09\xcb\x4a\xd4\xa8\x8a\x4c\x0e\xcb\x57\xc8\xc6\xba\x5d\xd2\xf4\x5a\xc3\x77\xe7\x11\xde\xdc\xdc\x6c\x89\xb1\x19\xb3\xd2\x1e\x2e\x25\x57\xf8\x56\x08\x42\xc4\xb8\x87\x64\x7Line truncated
func confLocaleLocale_enUsIniBytes() ([]byte, error) {
return bindataRead(
@@ -787,7 +787,7 @@ func confLocaleLocale_enUsIni() (*asset, error) {
return nil, err
}
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 36113, mode: os.FileMode(420), modTime: time.Unix(1439038800, 0)}
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 36142, mode: os.FileMode(420), modTime: time.Unix(1439104292, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@@ -987,7 +987,7 @@ func confLocaleLocale_zhCnIni() (*asset, error) {
return nil, err
}
info := bindataFileInfo{name: "conf/locale/locale_zh-CN.ini", size: 35357, mode: os.FileMode(493), modTime: time.Unix(1439005078, 0)}
info := bindataFileInfo{name: "conf/locale/locale_zh-CN.ini", size: 35357, mode: os.FileMode(493), modTime: time.Unix(1439087203, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
+1 -1
View File
@@ -1 +1 @@
@font-face{font-family:octicons;src:url(../fonts/octicons.eot?#iefix&v=345f8bad9c5003db196d08f05e7f030fd2a32ff6)format('embedded-opentype'),url(../fonts/octicons.woff?v=345f8bad9c5003db196d08f05e7f030fd2a32ff6)format('woff'),url(../fonts/octicons.ttf?v=345f8bad9c5003db196d08f05e7f030fd2a32ff6)format('truetype'),url(../fonts/octicons.svg?v=345f8bad9c5003db196d08f05e7f030fd2a32ff6#octicons)format('svg');font-weight:400;font-style:normal}.mega-octicon,.octicon{font:normal normal normal 16px/1 octicons;display:inline-block;text-decoration:none;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mega-octicon{font-size:32px}.octicon-alert:before{content:'\f02d'}.octicon-alignment-align:before{content:'\f08a'}.octicon-alignment-aligned-to:before{content:'\f08e'}.octicon-alignment-unalign:before{content:'\f08b'}.octicon-arrow-down:before{content:'\f03f'}.octicon-arrow-left:before{content:'\f040'}.octicon-arrow-right:before{content:'\f03e'}.octicon-arrow-small-down:before{content:'\f0a0'}.octicon-arrow-small-left:before{content:'\f0a1'}.octicon-arrow-small-right:before{content:'\f071'}.octicon-arrow-small-up:before{content:'\f09f'}.octicon-arrow-up:before{content:'\f03d'}.octicon-beer:before{content:'\f069'}.octicon-book:before{content:'\f007'}.octicon-bookmark:before{content:'\f07b'}.octicon-briefcase:before{content:'\f0d3'}.octicon-broadcast:before{content:'\f048'}.octicon-browser:before{content:'\f0c5'}.octicon-bug:before{content:'\f091'}.octicon-calendar:before{content:'\f068'}.octicon-check:before{content:'\f03a'}.octicon-checklist:before{content:'\f076'}.octicon-chevron-down:before{content:'\f0a3'}.octicon-chevron-left:before{content:'\f0a4'}.octicon-chevron-right:before{content:'\f078'}.octicon-chevron-up:before{content:'\f0a2'}.octicon-circle-slash:before{content:'\f084'}.octicon-circuit-board:before{content:'\f0d6'}.octicon-clippy:before{content:'\f035'}.octicon-clock:before{content:'\f046'}.octicon-cloud-download:before{content:'\f00b'}.octicon-cloud-upload:before{content:'\f00c'}.octicon-code:before{content:'\f05f'}.octicon-color-mode:before{content:'\f065'}.octicon-comment-add:before,.octicon-comment:before{content:'\f02b'}.octicon-comment-discussion:before{content:'\f04f'}.octicon-credit-card:before{content:'\f045'}.octicon-dash:before{content:'\f0ca'}.octicon-dashboard:before{content:'\f07d'}.octicon-database:before{content:'\f096'}.octicon-device-camera:before{content:'\f056'}.octicon-device-camera-video:before{content:'\f057'}.octicon-device-desktop:before{content:'\f27c'}.octicon-device-mobile:before{content:'\f038'}.octicon-diff:before{content:'\f04d'}.octicon-diff-added:before{content:'\f06b'}.octicon-diff-ignored:before{content:'\f099'}.octicon-diff-modified:before{content:'\f06d'}.octicon-diff-removed:before{content:'\f06c'}.octicon-diff-renamed:before{content:'\f06e'}.octicon-ellipsis:before{content:'\f09a'}.octicon-eye-unwatch:before,.octicon-eye-watch:before,.octicon-eye:before{content:'\f04e'}.octicon-file-binary:before{content:'\f094'}.octicon-file-code:before{content:'\f010'}.octicon-file-directory:before{content:'\f016'}.octicon-file-media:before{content:'\f012'}.octicon-file-pdf:before{content:'\f014'}.octicon-file-submodule:before{content:'\f017'}.octicon-file-symlink-directory:before{content:'\f0b1'}.octicon-file-symlink-file:before{content:'\f0b0'}.octicon-file-text:before{content:'\f011'}.octicon-file-zip:before{content:'\f013'}.octicon-flame:before{content:'\f0d2'}.octicon-fold:before{content:'\f0cc'}.octicon-gear:before{content:'\f02f'}.octicon-gift:before{content:'\f042'}.octicon-gist:before{content:'\f00e'}.octicon-gist-secret:before{content:'\f08c'}.octicon-git-branch-create:before,.octicon-git-branch-delete:before,.octicon-git-branch:before{content:'\f020'}.octicon-git-commit:before{content:'\f01f'}.octicon-git-compare:before{content:'\f0ac'}.octicon-git-merge:before{content:'\f023'}.octicon-git-pull-request-abandoned:before,.octicon-git-pull-request:before{content:'\f009'}.octicon-globe:before{content:'\f0b6'}.octicon-graph:before{content:'\f043'}.octicon-heart:before{content:'\2665'}.octicon-history:before{content:'\f07e'}.octicon-home:before{content:'\f08d'}.octicon-horizontal-rule:before{content:'\f070'}.octicon-hourglass:before{content:'\f09e'}.octicon-hubot:before{content:'\f09d'}.octicon-inbox:before{content:'\f0cf'}.octicon-info:before{content:'\f059'}.octicon-issue-closed:before{content:'\f028'}.octicon-issue-opened:before{content:'\f026'}.octicon-issue-reopened:before{content:'\f027'}.octicon-jersey:before{content:'\f019'}.octicon-jump-down:before{content:'\f072'}.octicon-jump-left:before{content:'\f0a5'}.octicon-jump-right:before{content:'\f0a6'}.octicon-jump-up:before{content:'\f073'}.octicon-key:before{content:'\f049'}.octicon-keyboard:before{content:'\f00d'}.octicon-law:before{content:'\f0d8'}.octicon-light-bulb:before{content:'\f000'}.octicoLine truncated
@font-face{font-family:octicons;src:url(../fonts/octicons.eot?#iefix&v=345f8bad9c5003db196d08f05e7f030fd2a32ff6)format('embedded-opentype'),url(../fonts/octicons.woff?v=345f8bad9c5003db196d08f05e7f030fd2a32ff6)format('woff'),url(../fonts/octicons.ttf?v=345f8bad9c5003db196d08f05e7f030fd2a32ff6)format('truetype'),url(../fonts/octicons.svg?v=345f8bad9c5003db196d08f05e7f030fd2a32ff6#octicons)format('svg');font-weight:400;font-style:normal}.mega-octicon,.octicon{font:normal normal normal 16px/1 octicons;display:inline-block;text-decoration:none;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mega-octicon{font-size:32px}.octicon-alert:before{content:'\f02d'}.octicon-alignment-align:before{content:'\f08a'}.octicon-alignment-aligned-to:before{content:'\f08e'}.octicon-alignment-unalign:before{content:'\f08b'}.octicon-arrow-down:before{content:'\f03f'}.octicon-arrow-left:before{content:'\f040'}.octicon-arrow-right:before{content:'\f03e'}.octicon-arrow-small-down:before{content:'\f0a0'}.octicon-arrow-small-left:before{content:'\f0a1'}.octicon-arrow-small-right:before{content:'\f071'}.octicon-arrow-small-up:before{content:'\f09f'}.octicon-arrow-up:before{content:'\f03d'}.octicon-beer:before{content:'\f069'}.octicon-book:before{content:'\f007'}.octicon-bookmark:before{content:'\f07b'}.octicon-briefcase:before{content:'\f0d3'}.octicon-broadcast:before{content:'\f048'}.octicon-browser:before{content:'\f0c5'}.octicon-bug:before{content:'\f091'}.octicon-calendar:before{content:'\f068'}.octicon-check:before{content:'\f03a'}.octicon-checklist:before{content:'\f076'}.octicon-chevron-down:before{content:'\f0a3'}.octicon-chevron-left:before{content:'\f0a4'}.octicon-chevron-right:before{content:'\f078'}.octicon-chevron-up:before{content:'\f0a2'}.octicon-circle-slash:before{content:'\f084'}.octicon-circuit-board:before{content:'\f0d6'}.octicon-clippy:before{content:'\f035'}.octicon-clock:before{content:'\f046'}.octicon-cloud-download:before{content:'\f00b'}.octicon-cloud-upload:before{content:'\f00c'}.octicon-code:before{content:'\f05f'}.octicon-color-mode:before{content:'\f065'}.octicon-comment-add:before,.octicon-comment:before{content:'\f02b'}.octicon-comment-discussion:before{content:'\f04f'}.octicon-credit-card:before{content:'\f045'}.octicon-dash:before{content:'\f0ca'}.octicon-dashboard:before{content:'\f07d'}.octicon-database:before{content:'\f096'}.octicon-device-camera:before{content:'\f056'}.octicon-device-camera-video:before{content:'\f057'}.octicon-device-desktop:before{content:'\f27c'}.octicon-device-mobile:before{content:'\f038'}.octicon-diff:before{content:'\f04d'}.octicon-diff-added:before{content:'\f06b'}.octicon-diff-ignored:before{content:'\f099'}.octicon-diff-modified:before{content:'\f06d'}.octicon-diff-removed:before{content:'\f06c'}.octicon-diff-renamed:before{content:'\f06e'}.octicon-ellipsis:before{content:'\f09a'}.octicon-eye-unwatch:before,.octicon-eye-watch:before,.octicon-eye:before{content:'\f04e'}.octicon-file-binary:before{content:'\f094'}.octicon-file-code:before{content:'\f010'}.octicon-file-directory:before{content:'\f016'}.octicon-file-media:before{content:'\f012'}.octicon-file-pdf:before{content:'\f014'}.octicon-file-submodule:before{content:'\f017'}.octicon-file-symlink-directory:before{content:'\f0b1'}.octicon-file-symlink-file:before{content:'\f0b0'}.octicon-file-text:before{content:'\f011'}.octicon-file-zip:before{content:'\f013'}.octicon-flame:before{content:'\f0d2'}.octicon-fold:before{content:'\f0cc'}.octicon-gear:before{content:'\f02f'}.octicon-gift:before{content:'\f042'}.octicon-gist:before{content:'\f00e'}.octicon-gist-secret:before{content:'\f08c'}.octicon-git-branch-create:before,.octicon-git-branch-delete:before,.octicon-git-branch:before{content:'\f020'}.octicon-git-commit:before{content:'\f01f'}.octicon-git-compare:before{content:'\f0ac'}.octicon-git-merge:before{content:'\f023'}.octicon-git-pull-request-abandoned:before,.octicon-git-pull-request:before{content:'\f009'}.octicon-globe:before{content:'\f0b6'}.octicon-graph:before{content:'\f043'}.octicon-heart:before{content:'\2665'}.octicon-history:before{content:'\f07e'}.octicon-home:before{content:'\f08d'}.octicon-horizontal-rule:before{content:'\f070'}.octicon-hourglass:before{content:'\f09e'}.octicon-hubot:before{content:'\f09d'}.octicon-inbox:before{content:'\f0cf'}.octicon-info:before{content:'\f059'}.octicon-issue-closed:before{content:'\f028'}.octicon-issue-opened:before{content:'\f026'}.octicon-issue-reopened:before{content:'\f027'}.octicon-jersey:before{content:'\f019'}.octicon-jump-down:before{content:'\f072'}.octicon-jump-left:before{content:'\f0a5'}.octicon-jump-right:before{content:'\f0a6'}.octicon-jump-up:before{content:'\f073'}.octicon-key:before{content:'\f049'}.octicon-keyboard:before{content:'\f00d'}.octicon-law:before{content:'\f0d8'}.octicon-light-bulb:before{content:'\f000'}.octicoLine truncated
+20
View File
@@ -123,6 +123,26 @@ $(document).ready(function () {
});
$('.poping.up').popup();
// Comment form
$('.comment.form .tabular.menu .item').tab();
$('.comment.form .tabular.menu .item[data-tab="preview"]').click(function () {
var $this = $(this);
console.log($('.comment.form .tab.segment[data-tab="write"] textarea').val())
console.log($('.comment.form .tab.segment[data-tab="preview"]').html())
$.post($this.data('url'), {
"_csrf": csrf,
"mode": "gfm",
"context": $this.data('context'),
"text": $('.comment.form .tab.segment[data-tab="write"] textarea').val()
},
function (data) {
console.log(data)
$('.comment.form .tab.segment[data-tab="preview"]').html(data);
}
)
;
})
// Helpers.
$('.delete-button').click(function () {
var $this = $(this);
+594
View File
@@ -0,0 +1,594 @@
.markdown {
overflow:hidden;
font-family:"Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif;
font-size:16px;
line-height:1.6;
word-wrap:break-word;
>*:first-child {
margin-top:0 !important;
}
>*:last-child {
margin-bottom:0 !important;
}
a:not([href]) {
color:inherit;
text-decoration:none;
}
.absent {
color:#c00;
}
.anchor {
position:absolute;
top:0;
left:0;
display:block;
padding-right:6px;
padding-left:30px;
margin-left:-30px;
}
.anchor:focus {
outline:none;
}
h1,
h2,
h3,
h4,
h5,
h6 {
position:relative;
margin-top:1em;
margin-bottom:16px;
font-weight:bold;
line-height:1.4;
}
h1 .octicon-link,
h2 .octicon-link,
h3 .octicon-link,
h4 .octicon-link,
h5 .octicon-link,
h6 .octicon-link {
display:none;
color:#000;
vertical-align:middle;
}
h1:hover .anchor,
h2:hover .anchor,
h3:hover .anchor,
h4:hover .anchor,
h5:hover .anchor,
h6:hover .anchor {
padding-left:8px;
margin-left:-30px;
text-decoration:none;
}
h1:hover .anchor .octicon-link,
h2:hover .anchor .octicon-link,
h3:hover .anchor .octicon-link,
h4:hover .anchor .octicon-link,
h5:hover .anchor .octicon-link,
h6:hover .anchor .octicon-link {
display:inline-block;
}
h1 tt,
h1 code,
h2 tt,
h2 code,
h3 tt,
h3 code,
h4 tt,
h4 code,
h5 tt,
h5 code,
h6 tt,
h6 code {
font-size:inherit;
}
h1 {
padding-bottom:0.3em;
font-size:2.25em;
line-height:1.2;
border-bottom:1px solid #eee;
}
h1 .anchor {
line-height:1;
}
h2 {
padding-bottom:0.3em;
font-size:1.75em;
line-height:1.225;
border-bottom:1px solid #eee;
}
h2 .anchor {
line-height:1;
}
h3 {
font-size:1.5em;
line-height:1.43;
}
h3 .anchor {
line-height:1.2;
}
h4 {
font-size:1.25em;
}
h4 .anchor {
line-height:1.2;
}
h5 {
font-size:1em;
}
h5 .anchor {
line-height:1.1;
}
h6 {
font-size:1em;color:#777;
}
h6 .anchor {
line-height:1.1;
}
p,
blockquote,
ul,
ol,
dl,
table,
pre {
margin-top:0;
margin-bottom:16px;
}
hr {
height:4px;
padding:0;
margin:16px 0;
background-color:#e7e7e7;
border:0 none;
}
ul,
ol {
padding-left:2em;
}
ul.no-list,
ol.no-list {
padding:0;
list-style-type:none;
}
ul ul,
ul ol,
ol ol,
ol ul {
margin-top:0;
margin-bottom:0;
}
ol ol,
ul ol {
list-style-type: lower-roman;
}
li>p {
margin-top:16px;
}
dl {
padding:0;
}
dl dt {
padding:0;
margin-top:16px;
font-size:1em;
font-style:italic;
font-weight:bold;
}
dl dd {
padding:0 16px;
margin-bottom:16px;
}
blockquote {
padding:0 15px;
color:#777;
border-left:4px solid #ddd;
}
blockquote>:first-child {
margin-top:0;
}
blockquote>:last-child {
margin-bottom:0;
}
table {
display:block;
width:100%;
overflow:auto;
word-break:normal;
word-break:keep-all;
}
table th {
font-weight:bold;
}
table th,
table td {
padding:6px 13px !important;
border:1px solid #ddd;
}
table tr {
background-color:#fff;
border-top:1px solid #ccc;
}
table tr:nth-child(2n) {
background-color:#f8f8f8;
}
img {
max-width:100%;
box-sizing:border-box;
}
.emoji {
max-width:none;
}
span.frame {
display:block;
overflow:hidden;
}
span.frame>span {
display:block;
float:left;
width:auto;
padding:7px;
margin:13px 0 0;
overflow:hidden;
border:1px solid #ddd;
}
span.frame span img {
display:block;
float:left;
}
span.frame span span {
display:block;
padding:5px 0 0;
clear:both;
color:#333;
}
span.align-center {
display:block;
overflow:hidden;
clear:both;
}
span.align-center>span {
display:block;
margin:13px auto 0;
overflow:hidden;
text-align:center;
}
span.align-center span img {
margin:0 auto;
text-align:center;
}
span.align-right {
display:block;
overflow:hidden;
clear:both;
}
span.align-right>span {
display:block;
margin:13px 0 0;
overflow:hidden;
text-align:right;
}
span.align-right span img {
margin:0;
text-align:right;
}
span.float-left {
display:block;
float:left;
margin-right:13px;
overflow:hidden;
}
span.float-left span {
margin:13px 0 0;
}
span.float-right {
display:block;
float:right;
margin-left:13px;
overflow:hidden;
}
span.float-right>span {
display:block;
margin:13px auto 0;
overflow:hidden;
text-align:right;
}
code,
tt {
padding:0;
padding-top:0.2em;
padding-bottom:0.2em;
margin:0;
font-size:85%;
background-color:rgba(0,0,0,0.04);
border-radius:3px;
}
code:before,
code:after,
tt:before,
tt:after {
letter-spacing:-0.2em;
content:"\00a0";
}
code br,
tt br {
display:none;
}
del code {
text-decoration:inherit;
}
pre>code {
padding:0;
margin:0;
font-size:100%;
word-break:normal;
white-space:pre;
background:transparent;
border:0;
}
.highlight {
margin-bottom:16px;
}
.highlight pre,
pre {
padding:16px;
overflow:auto;
font-size:85%;
line-height:1.45;
background-color:#f7f7f7;
border-radius:3px;
}
.highlight pre {
margin-bottom:0;
word-break:normal;
}
pre {
word-wrap:normal;
}
pre code,
pre tt {
display:inline;
max-width:initial;
padding:0;
margin:0;
overflow:initial;
line-height:inherit;
word-wrap:normal;
background-color:transparent;
border:0;
}
pre code:before,
pre code:after,
pre tt:before,
pre tt:after {
content:normal;
}
kbd {
display:inline-block;
padding:3px 5px;
font-size:11px;
line-height:10px;
color:#555;
vertical-align:middle;
background-color:#fcfcfc;
border:solid 1px #ccc;
border-bottom-color:#bbb;
border-radius:3px;
box-shadow:inset 0 -1px 0 #bbb;
}
.csv-data td,
.csv-data th {
padding:5px;
overflow:hidden;
font-size:12px;
line-height:1;
text-align:left;
white-space:nowrap;
}
.csv-data .blob-num {
padding:10px 8px 9px;
text-align:right;
background:#fff;border:0;
}
.csv-data tr {
border-top:0;
}
.csv-data th {
font-weight:bold;
background:#f8f8f8;border-top:0;
}
}
/* Author: jmblog */
/* Project: https://github.com/jmblog/color-themes-for-google-code-prettify */
/* GitHub Theme */
/* Pretty printing styles. Used with prettify.js. */
/* SPAN elements with the classes below are added by prettyprint. */
/* plain text */
.pln {
color: #333333;
}
@media screen {
/* string content */
.str {
color: #dd1144;
}
/* a keyword */
.kwd {
color: #333333;
}
/* a comment */
.com {
color: #999988;
font-style: italic;
}
/* a type name */
.typ {
color: #445588;
}
/* a literal value */
.lit {
color: #445588;
}
/* punctuation */
.pun {
color: #333333;
}
/* lisp open bracket */
.opn {
color: #333333;
}
/* lisp close bracket */
.clo {
color: #333333;
}
/* a markup tag name */
.tag {
color: navy;
}
/* a markup attribute name */
.atn {
color: teal;
}
/* a markup attribute value */
.atv {
color: #dd1144;
}
/* a declaration */
.dec {
color: #333333;
}
/* a variable name */
.var {
color: teal;
}
/* a function name */
.fun {
color: #990000;
}
}
/* Use higher contrast and text-weight for printable form. */
@media print,
projection {
.str {
color: #006600;
}
.kwd {
color: #006;
font-weight: bold;
}
.com {
color: #600;
font-style: italic;
}
.typ {
color: #404;
font-weight: bold;
}
.lit {
color: #004444;
}
.pun,
.opn,
.clo {
color: #444400;
}
.tag {
color: #006;
font-weight: bold;
}
.atn {
color: #440044;
}
.atv {
color: #006600;
}
}
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin-top: 0;
margin-bottom: 0;
}
+27
View File
@@ -105,6 +105,7 @@
.page.buttons {
padding-top: 15px;
}
.issue.list {
clear: both;
list-style: none;
@@ -138,6 +139,32 @@
}
}
}
&.new.issue {
.comment.form {
.metas {
min-width: 220px;
}
}
}
.comment.form {
.ui.comments {
margin-top: -12px;
max-width: 750px!important;
}
.content {
.field:first-child {
clear: none;
}
.tab.segment {
border: none;
padding: 0;
padding-top: 10px;
}
textarea {
height: 200px;
}
}
}
.label.list {
clear: both;
+1
View File
@@ -1,5 +1,6 @@
@import "_octicons";
@import "_base";
@import "_markdown";
@import "_home";
@import "_install";
@import "_form";
+176 -145
View File
@@ -27,9 +27,9 @@ import (
)
const (
ISSUES base.TplName = "repo/issue/list"
ISSUE_CREATE base.TplName = "repo/issue/create"
ISSUE_VIEW base.TplName = "repo/issue/view"
ISSUES base.TplName = "repo/issue/list"
ISSUE_NEW base.TplName = "repo/issue/new"
ISSUE_VIEW base.TplName = "repo/issue/view"
LABELS base.TplName = "repo/issue/labels"
@@ -174,167 +174,198 @@ func Issues(ctx *middleware.Context) {
ctx.HTML(200, ISSUES)
}
func CreateIssue(ctx *middleware.Context) {
ctx.Data["Title"] = "Create issue"
ctx.Data["IsRepoToolbarIssues"] = true
ctx.Data["IsRepoToolbarIssuesList"] = false
ctx.Data["AttachmentsEnabled"] = setting.AttachmentEnabled
func NewIssue(ctx *middleware.Context) {
ctx.Data["Title"] = ctx.Tr("repo.issues.new")
ctx.Data["PageIsIssueList"] = true
ctx.Data["IsAttachmentEnabled"] = setting.AttachmentEnabled
ctx.Data["AttachmentAllowedTypes"] = setting.AttachmentAllowedTypes
var (
repo = ctx.Repo.Repository
err error
)
// Get all milestones.
ctx.Data["OpenMilestones"], err = models.GetMilestones(repo.ID, -1, false)
if err != nil {
ctx.Handle(500, "GetMilestones.1: %v", err)
return
}
ctx.Data["ClosedMilestones"], err = models.GetMilestones(repo.ID, -1, true)
if err != nil {
ctx.Handle(500, "GetMilestones.2: %v", err)
// var (
// repo = ctx.Repo.Repository
// err error
// )
// // Get all milestones.
// ctx.Data["OpenMilestones"], err = models.GetMilestones(repo.ID, -1, false)
// if err != nil {
// ctx.Handle(500, "GetMilestones.1: %v", err)
// return
// }
// ctx.Data["ClosedMilestones"], err = models.GetMilestones(repo.ID, -1, true)
// if err != nil {
// ctx.Handle(500, "GetMilestones.2: %v", err)
// return
// }
// us, err := repo.GetCollaborators()
// if err != nil {
// ctx.Handle(500, "GetCollaborators", err)
// return
// }
// ctx.Data["Collaborators"] = us
ctx.HTML(200, ISSUE_NEW)
}
func NewIssuePost(ctx *middleware.Context, form auth.CreateIssueForm) {
ctx.Data["Title"] = ctx.Tr("repo.issues.new")
ctx.Data["PageIsIssueList"] = true
ctx.Data["IsAttachmentEnabled"] = setting.AttachmentEnabled
ctx.Data["AttachmentAllowedTypes"] = setting.AttachmentAllowedTypes
if ctx.HasError() {
ctx.HTML(200, ISSUE_NEW)
return
}
us, err := repo.GetCollaborators()
if err != nil {
ctx.Handle(500, "GetCollaborators", err)
issue := &models.Issue{
RepoID: ctx.Repo.Repository.ID,
Index: int64(ctx.Repo.Repository.NumIssues) + 1,
Name: form.Title,
PosterID: ctx.User.Id,
// MilestoneID: form.MilestoneID,
// AssigneeID: form.AssigneeID,
// LabelIDs: "$" + strings.Join(form.LabelIDs, "|$") + "|",
Content: form.Content,
}
if err := models.NewIssue(issue); err != nil {
ctx.Handle(500, "NewIssue", err)
return
} else if err := models.NewIssueUserPairs(ctx.Repo.Repository, issue); err != nil {
ctx.Handle(500, "NewIssue", err)
return
}
ctx.Data["AllowedTypes"] = setting.AttachmentAllowedTypes
ctx.Data["Collaborators"] = us
ctx.HTML(200, ISSUE_CREATE)
ctx.Redirect(ctx.Repo.RepoLink + "/issues/" + com.ToStr(issue.Index))
}
func CreateIssuePost(ctx *middleware.Context, form auth.CreateIssueForm) {
send := func(status int, data interface{}, err error) {
if err != nil {
log.Error(4, "issue.CreateIssuePost(?): %s", err)
// send := func(status int, data interface{}, err error) {
// if err != nil {
// log.Error(4, "issue.CreateIssuePost(?): %s", err)
ctx.JSON(status, map[string]interface{}{
"ok": false,
"status": status,
"error": err.Error(),
})
} else {
ctx.JSON(status, map[string]interface{}{
"ok": true,
"status": status,
"data": data,
})
}
}
// ctx.JSON(status, map[string]interface{}{
// "ok": false,
// "status": status,
// "error": err.Error(),
// })
// } else {
// ctx.JSON(status, map[string]interface{}{
// "ok": true,
// "status": status,
// "data": data,
// })
// }
// }
var err error
// Get all milestones.
_, err = models.GetMilestones(ctx.Repo.Repository.ID, -1, false)
if err != nil {
send(500, nil, err)
return
}
_, err = models.GetMilestones(ctx.Repo.Repository.ID, -1, true)
if err != nil {
send(500, nil, err)
return
}
// var err error
// // Get all milestones.
// _, err = models.GetMilestones(ctx.Repo.Repository.ID, -1, false)
// if err != nil {
// send(500, nil, err)
// return
// }
// _, err = models.GetMilestones(ctx.Repo.Repository.ID, -1, true)
// if err != nil {
// send(500, nil, err)
// return
// }
_, err = ctx.Repo.Repository.GetCollaborators()
if err != nil {
send(500, nil, err)
return
}
// _, err = ctx.Repo.Repository.GetCollaborators()
// if err != nil {
// send(500, nil, err)
// return
// }
if ctx.HasError() {
send(400, nil, errors.New(ctx.Flash.ErrorMsg))
return
}
// if ctx.HasError() {
// send(400, nil, errors.New(ctx.Flash.ErrorMsg))
// return
// }
// Only collaborators can assign.
if !ctx.Repo.IsOwner() {
form.AssigneeId = 0
}
issue := &models.Issue{
RepoID: ctx.Repo.Repository.ID,
Index: int64(ctx.Repo.Repository.NumIssues) + 1,
Name: form.IssueName,
PosterID: ctx.User.Id,
MilestoneID: form.MilestoneId,
AssigneeID: form.AssigneeId,
LabelIds: form.Labels,
Content: form.Content,
}
if err := models.NewIssue(issue); err != nil {
send(500, nil, err)
return
} else if err := models.NewIssueUserPairs(ctx.Repo.Repository, issue.ID, ctx.Repo.Owner.Id,
ctx.User.Id, form.AssigneeId); err != nil {
send(500, nil, err)
return
}
// // Only collaborators can assign.
// if !ctx.Repo.IsOwner() {
// form.AssigneeId = 0
// }
// issue := &models.Issue{
// RepoID: ctx.Repo.Repository.ID,
// Index: int64(ctx.Repo.Repository.NumIssues) + 1,
// Name: form.IssueName,
// PosterID: ctx.User.Id,
// MilestoneID: form.MilestoneId,
// AssigneeID: form.AssigneeId,
// LabelIds: form.Labels,
// Content: form.Content,
// }
// if err := models.NewIssue(issue); err != nil {
// send(500, nil, err)
// return
// } else if err := models.NewIssueUserPairs(ctx.Repo.Repository, issue.ID, ctx.Repo.Owner.Id,
// ctx.User.Id, form.AssigneeId); err != nil {
// send(500, nil, err)
// return
// }
if setting.AttachmentEnabled {
uploadFiles(ctx, issue.ID, 0)
}
// if setting.AttachmentEnabled {
// uploadFiles(ctx, issue.ID, 0)
// }
// Update mentions.
ms := base.MentionPattern.FindAllString(issue.Content, -1)
if len(ms) > 0 {
for i := range ms {
ms[i] = ms[i][1:]
}
// // Update mentions.
// ms := base.MentionPattern.FindAllString(issue.Content, -1)
// if len(ms) > 0 {
// for i := range ms {
// ms[i] = ms[i][1:]
// }
if err := models.UpdateMentions(ms, issue.ID); err != nil {
send(500, nil, err)
return
}
}
// if err := models.UpdateMentions(ms, issue.ID); err != nil {
// send(500, nil, err)
// return
// }
// }
act := &models.Action{
ActUserID: ctx.User.Id,
ActUserName: ctx.User.Name,
ActEmail: ctx.User.Email,
OpType: models.CREATE_ISSUE,
Content: fmt.Sprintf("%d|%s", issue.Index, issue.Name),
RepoID: ctx.Repo.Repository.ID,
RepoUserName: ctx.Repo.Owner.Name,
RepoName: ctx.Repo.Repository.Name,
RefName: ctx.Repo.BranchName,
IsPrivate: ctx.Repo.Repository.IsPrivate,
}
// Notify watchers.
if err := models.NotifyWatchers(act); err != nil {
send(500, nil, err)
return
}
// act := &models.Action{
// ActUserID: ctx.User.Id,
// ActUserName: ctx.User.Name,
// ActEmail: ctx.User.Email,
// OpType: models.CREATE_ISSUE,
// Content: fmt.Sprintf("%d|%s", issue.Index, issue.Name),
// RepoID: ctx.Repo.Repository.ID,
// RepoUserName: ctx.Repo.Owner.Name,
// RepoName: ctx.Repo.Repository.Name,
// RefName: ctx.Repo.BranchName,
// IsPrivate: ctx.Repo.Repository.IsPrivate,
// }
// // Notify watchers.
// if err := models.NotifyWatchers(act); err != nil {
// send(500, nil, err)
// return
// }
// Mail watchers and mentions.
if setting.Service.EnableNotifyMail {
tos, err := mailer.SendIssueNotifyMail(ctx.User, ctx.Repo.Owner, ctx.Repo.Repository, issue)
if err != nil {
send(500, nil, err)
return
}
// // Mail watchers and mentions.
// if setting.Service.EnableNotifyMail {
// tos, err := mailer.SendIssueNotifyMail(ctx.User, ctx.Repo.Owner, ctx.Repo.Repository, issue)
// if err != nil {
// send(500, nil, err)
// return
// }
tos = append(tos, ctx.User.LowerName)
newTos := make([]string, 0, len(ms))
for _, m := range ms {
if com.IsSliceContainsStr(tos, m) {
continue
}
// tos = append(tos, ctx.User.LowerName)
// newTos := make([]string, 0, len(ms))
// for _, m := range ms {
// if com.IsSliceContainsStr(tos, m) {
// continue
// }
newTos = append(newTos, m)
}
if err = mailer.SendIssueMentionMail(ctx.Render, ctx.User, ctx.Repo.Owner,
ctx.Repo.Repository, issue, models.GetUserEmailsByNames(newTos)); err != nil {
send(500, nil, err)
return
}
}
log.Trace("%d Issue created: %d", ctx.Repo.Repository.ID, issue.ID)
// newTos = append(newTos, m)
// }
// if err = mailer.SendIssueMentionMail(ctx.Render, ctx.User, ctx.Repo.Owner,
// ctx.Repo.Repository, issue, models.GetUserEmailsByNames(newTos)); err != nil {
// send(500, nil, err)
// return
// }
// }
// log.Trace("%d Issue created: %d", ctx.Repo.Repository.ID, issue.ID)
send(200, fmt.Sprintf("%s/%s/%s/issues/%d", setting.AppSubUrl, ctx.Params(":username"), ctx.Params(":reponame"), issue.Index), nil)
// send(200, fmt.Sprintf("%s/%s/%s/issues/%d", setting.AppSubUrl, ctx.Params(":username"), ctx.Params(":reponame"), issue.Index), nil)
}
func checkLabels(labels, allLabels []*models.Label) {
@@ -484,7 +515,7 @@ func UpdateIssue(ctx *middleware.Context, form auth.CreateIssueForm) {
return
}
issue.Name = form.IssueName
issue.Name = form.Title
//issue.MilestoneId = form.MilestoneId
//issue.AssigneeId = form.AssigneeId
//issue.LabelIds = form.Labels
@@ -540,16 +571,16 @@ func UpdateIssueLabel(ctx *middleware.Context) {
return
}
isHad := strings.Contains(issue.LabelIds, "$"+labelStrId+"|")
isHad := strings.Contains(issue.LabelIDs, "$"+labelStrId+"|")
isNeedUpdate := false
if isAttach {
if !isHad {
issue.LabelIds += "$" + labelStrId + "|"
issue.LabelIDs += "$" + labelStrId + "|"
isNeedUpdate = true
}
} else {
if isHad {
issue.LabelIds = strings.Replace(issue.LabelIds, "$"+labelStrId+"|", "", -1)
issue.LabelIDs = strings.Replace(issue.LabelIDs, "$"+labelStrId+"|", "", -1)
isNeedUpdate = true
}
}
+1 -1
View File
@@ -1 +1 @@
0.6.4.0808 Beta
0.6.4.0809 Beta
+14
View File
@@ -0,0 +1,14 @@
{{template "base/head" .}}
<div class="repository new issue">
{{template "repo/header" .}}
<div class="ui middle page grid body">
<div class="navbar">
{{template "repo/issue/navbar" .}}
</div>
<div class="ui divider"></div>
<div class="sixteen wide column page grid">
{{template "repo/issue/new_form" .}}
</div>
</div>
</div>
{{template "base/footer" .}}
+88
View File
@@ -0,0 +1,88 @@
<form class="ui comment form grid" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
{{if .Flash}}
<div class="sixteen wide column">
{{template "base/alert" .}}
</div>
{{end}}
<div class="twelve wide column">
<div class="ui comments">
<div class="comment">
<a class="avatar">
<img src="{{.SignedUser.AvatarLink}}">
</a>
<div class="ui segment content">
<div class="field">
<input name="title" placeholder="{{.i18n.Tr "repo.milestones.title"}}" value="{{.title}}" autofocus required>
</div>
<div class="field">
<div class="ui top attached tabular menu">
<a class="active item" data-tab="write">{{.i18n.Tr "repo.release.write"}}</a>
<a class="item" data-tab="preview" data-url="/api/v1/markdown" data-context="{{.RepoLink}}">{{.i18n.Tr "repo.release.preview"}}</a>
</div>
<div class="ui bottom attached active tab segment" data-tab="write">
<textarea name="content"></textarea>
</div>
<div class="ui bottom attached tab segment markdown" data-tab="preview">
{{.i18n.Tr "repo.release.loading"}}
</div>
</div>
<button class="ui right green button">
{{.i18n.Tr "repo.issues.create"}}
</button>
</div>
</div>
</div>
</div>
<div class="four wide column">
<div class="ui segment metas">
<div class="ui {{if .Labels}}disabled{{end}} pointing dropdown jump item">
<span class="text">
<strong>{{.i18n.Tr "repo.issues.new.labels"}}</strong>
<span class="octicon octicon-gear"></span>
</span>
<div class="menu">
<a class="item" href="{{$.RepoLink}}/issues?type={{$.ViewType}}&state={{$.State}}&milestone={{$.MilestoneID}}">{{.i18n.Tr "repo.issues.filter_label_no_select"}}</a>
{{range .Labels}}
<a class="item" href="{{$.RepoLink}}/issues?type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}"><span class="octicon {{if eq $.SelectLabels .ID}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a>
{{end}}
</div>
</div>
<div class="ui list">
<span class="item">filter_label_no_select</span>
</div>
<div class="ui divider"></div>
<div class="ui {{if .Labels}}disabled{{end}} pointing dropdown jump item">
<span class="text">
<strong>{{.i18n.Tr "repo.issues.new.labels"}}</strong>
<span class="octicon octicon-gear"></span>
</span>
<div class="menu">
<a class="item" href="{{$.RepoLink}}/issues?type={{$.ViewType}}&state={{$.State}}&milestone={{$.MilestoneID}}">{{.i18n.Tr "repo.issues.filter_label_no_select"}}</a>
{{range .Labels}}
<a class="item" href="{{$.RepoLink}}/issues?type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}"><span class="octicon {{if eq $.SelectLabels .ID}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a>
{{end}}
</div>
</div>
<div class="ui list">
<span class="item">filter_label_no_select</span>
</div>
<div class="ui divider"></div>
<div class="ui {{if .Labels}}disabled{{end}} pointing dropdown jump item">
<span class="text">
<strong>{{.i18n.Tr "repo.issues.new.labels"}}</strong>
<span class="octicon octicon-gear"></span>
</span>
<div class="menu">
<a class="item" href="{{$.RepoLink}}/issues?type={{$.ViewType}}&state={{$.State}}&milestone={{$.MilestoneID}}">{{.i18n.Tr "repo.issues.filter_label_no_select"}}</a>
{{range .Labels}}
<a class="item" href="{{$.RepoLink}}/issues?type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}"><span class="octicon {{if eq $.SelectLabels .ID}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a>
{{end}}
</div>
</div>
<div class="ui list">
<span class="item">filter_label_no_select</span>
</div>
</div>
</div>
</form>
+1
View File
@@ -45,6 +45,7 @@
</div>
</div>
</div>
{{template "repo/issue/new_form" .}}
</div>
</div>
</div>