mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-14 01:35:55 +09:00
finish create issue with milestone
This commit is contained in:
1 parent
922f3f3062
commit
09a1b2a1f5
10 files changed
+257
-155
No files matched your search
@@ -368,10 +368,14 @@ commits.newer = Newer
|
||||
|
||||
issues.new = New Issue
|
||||
issues.new.labels = Labels
|
||||
issues.new.no_label = No Label
|
||||
issues.new.clear_labels = Clear labels
|
||||
issues.new.milestone = Milestone
|
||||
issues.new.no_milestone = No Milestone
|
||||
issues.new.clear_milestone = Clear milestone
|
||||
issues.new.open_milestone = Open Milestones
|
||||
issues.new.closed_milestone = Closed Milestones
|
||||
issues.new.assignee = Assignee
|
||||
issues.new.no_label = No Label
|
||||
issues.create = Create Issue
|
||||
issues.new_label = New Label
|
||||
issues.new_label_placeholder = Label name...
|
||||
|
||||
+3
-2
@@ -267,7 +267,8 @@ func (err ErrLabelNotExist) Error() string {
|
||||
// \/ \/ \/ \/ \/
|
||||
|
||||
type ErrMilestoneNotExist struct {
|
||||
ID int64
|
||||
ID int64
|
||||
RepoID int64
|
||||
}
|
||||
|
||||
func IsErrMilestoneNotExist(err error) bool {
|
||||
@@ -276,5 +277,5 @@ func IsErrMilestoneNotExist(err error) bool {
|
||||
}
|
||||
|
||||
func (err ErrMilestoneNotExist) Error() string {
|
||||
return fmt.Sprintf("milestone does not exist [id: %d]", err.ID)
|
||||
return fmt.Sprintf("milestone does not exist [id: %d, repo_id: %d]", err.ID, err.RepoID)
|
||||
}
|
||||
+53
-43
@@ -164,16 +164,13 @@ func NewIssue(issue *Issue, labelIDs []int64) (err error) {
|
||||
}
|
||||
}
|
||||
|
||||
if err = sess.Commit(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if issue.MilestoneID > 0 {
|
||||
// FIXES(280): Update milestone counter.
|
||||
return ChangeMilestoneAssign(0, issue.MilestoneID, issue)
|
||||
if err = changeMilestoneAssign(sess, 0, issue); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
return sess.Commit()
|
||||
}
|
||||
|
||||
// GetIssueByRef returns an Issue specified by a GFM reference.
|
||||
@@ -497,15 +494,14 @@ func GetUserIssueStats(uid int64, filterMode int) *IssueStats {
|
||||
return stats
|
||||
}
|
||||
|
||||
func updateIssue(e Engine, issue *Issue) error {
|
||||
_, err := e.Id(issue.ID).AllCols().Update(issue)
|
||||
return err
|
||||
}
|
||||
|
||||
// UpdateIssue updates information of issue.
|
||||
func UpdateIssue(issue *Issue) error {
|
||||
_, err := x.Id(issue.ID).AllCols().Update(issue)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return err
|
||||
return updateIssue(x, issue)
|
||||
}
|
||||
|
||||
// UpdateIssueUserByStatus updates issue-user pairs by issue status.
|
||||
@@ -712,7 +708,7 @@ func NewIssueLabel(issueID, labelID int64) error {
|
||||
|
||||
func getIssueLabels(e Engine, issueID int64) ([]*IssueLabel, error) {
|
||||
issueLabels := make([]*IssueLabel, 0, 10)
|
||||
return issueLabels, e.Where("issue_id=?", issueID).Find(&issueLabels)
|
||||
return issueLabels, e.Where("issue_id=?", issueID).Asc("label_id").Find(&issueLabels)
|
||||
}
|
||||
|
||||
// GetIssueLabels returns all issue-label relations of given issue by ID.
|
||||
@@ -802,14 +798,30 @@ func NewMilestone(m *Milestone) (err error) {
|
||||
return sess.Commit()
|
||||
}
|
||||
|
||||
// GetMilestoneByID returns the milestone of given ID.
|
||||
func GetMilestoneByID(id int64) (*Milestone, error) {
|
||||
func getMilestoneByID(e Engine, id int64) (*Milestone, error) {
|
||||
m := &Milestone{ID: id}
|
||||
has, err := x.Get(m)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if !has {
|
||||
return nil, ErrMilestoneNotExist{id}
|
||||
return nil, ErrMilestoneNotExist{id, 0}
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// GetMilestoneByID returns the milestone of given ID.
|
||||
func GetMilestoneByID(id int64) (*Milestone, error) {
|
||||
return getMilestoneByID(x, id)
|
||||
}
|
||||
|
||||
// GetRepoMilestoneByID returns the milestone of given ID and repository.
|
||||
func GetRepoMilestoneByID(repoID, milestoneID int64) (*Milestone, error) {
|
||||
m := &Milestone{ID: milestoneID, RepoID: repoID}
|
||||
has, err := x.Get(m)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if !has {
|
||||
return nil, ErrMilestoneNotExist{milestoneID, repoID}
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
@@ -915,16 +927,9 @@ func ChangeMilestoneIssueStats(issue *Issue) error {
|
||||
return UpdateMilestone(m)
|
||||
}
|
||||
|
||||
// ChangeMilestoneAssign changes assignment of milestone for issue.
|
||||
func ChangeMilestoneAssign(oldMid, mid int64, issue *Issue) (err error) {
|
||||
sess := x.NewSession()
|
||||
defer sess.Close()
|
||||
if err = sess.Begin(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
func changeMilestoneAssign(e *xorm.Session, oldMid int64, issue *Issue) error {
|
||||
if oldMid > 0 {
|
||||
m, err := GetMilestoneByID(oldMid)
|
||||
m, err := getMilestoneByID(e, oldMid)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -934,20 +939,15 @@ func ChangeMilestoneAssign(oldMid, mid int64, issue *Issue) (err error) {
|
||||
m.NumClosedIssues--
|
||||
}
|
||||
|
||||
if _, err = sess.Id(m.ID).AllCols().Update(m); err != nil {
|
||||
sess.Rollback()
|
||||
if err = updateMilestone(e, m); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
rawSql := "UPDATE `issue_user` SET milestone_id = 0 WHERE issue_id = ?"
|
||||
if _, err = sess.Exec(rawSql, issue.ID); err != nil {
|
||||
sess.Rollback()
|
||||
} else if _, err = e.Exec("UPDATE `issue_user` SET milestone_id=0 WHERE issue_id=?", issue.ID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if mid > 0 {
|
||||
m, err := GetMilestoneByID(mid)
|
||||
if issue.MilestoneID > 0 {
|
||||
m, err := GetMilestoneByID(issue.MilestoneID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -961,16 +961,26 @@ func ChangeMilestoneAssign(oldMid, mid int64, issue *Issue) (err error) {
|
||||
return ErrWrongIssueCounter
|
||||
}
|
||||
|
||||
if _, err = sess.Id(m.ID).AllCols().Update(m); err != nil {
|
||||
sess.Rollback()
|
||||
if err = updateMilestone(e, m); err != nil {
|
||||
return err
|
||||
} else if _, err = e.Exec("UPDATE `issue_user` SET milestone_id=? WHERE issue_id=?", m.ID, issue.ID); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
rawSql := "UPDATE `issue_user` SET milestone_id = ? WHERE issue_id = ?"
|
||||
if _, err = sess.Exec(rawSql, m.ID, issue.ID); err != nil {
|
||||
sess.Rollback()
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ChangeMilestoneAssign changes assignment of milestone for issue.
|
||||
func ChangeMilestoneAssign(oldMid int64, issue *Issue) (err error) {
|
||||
sess := x.NewSession()
|
||||
defer sess.Close()
|
||||
if err = sess.Begin(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err = changeMilestoneAssign(sess, oldMid, issue); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return sess.Commit()
|
||||
|
||||
@@ -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\x79\xab\xac\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\x58\x2a\xb4\xe5\xae\x21\xee\xe0\x88\xbd\x22\x82\x3a\x54\x54\x48\x33\xed\xf2\x5b\xda\x6f\x7d\x93\xf6\x9b\xaa\x4b\x0b\x22\xb6\x15\x37\x4c\x5b\x63\x20\x7e\x2c\x64\x41\x04\x2a\xa4\x61\x79\xf1\x1a\x00\x6a\x37\x10\x35\x6d\xa8\x31\xe6\xf6\x2c\x9a\xa8\xc9\xb9\x71\x62\x4a\xd4\x0e\xe8\x9b\x28\xb7\x21\xde\xca\xdc\xef\x1c\x09\xfd\x1d\xb6\x4f\xa3\xca\x6f\x6e\x68\x54\x1d\x51\xc5\xab\x74\xb5\x6d\x88\xa4\x3e\xbc\x7f\x43\x95\x37\x7d\xbf\xcf\xf6\x4d\x0b\x32\xbe\xbe\x7e\x47\xdb\xa3\xed\x7d\x6e\x80\x6b\x86\xa9\x87\xdd\x92\x7e\x1d\x36\x15\x31\x81\x3c\x58\x20\xa0\x62\xcb\x02\xa6\x4e\x9b\x7a\x81\xb5\x1a\xda\xed\x68\x19\xa9\x4b\x2b\x39\x32\x3c\x1e\xc2\x13\xfe\x73\xe5\x47\x89\xe9\x76\x24\x85\x0f\x58\x54\x9a\x6a\x09\x69\x42\xb4\xd5\xec\xb9\xdd\x80\xb8\x2e\x35\xc3\x53\x14\x24\x90\x2b\x17\x39\x44\xa5\x90\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\x02\xd1\x81\xd2\xce\xed\x69\xf9\x1f\x30\x81\x3f\x48\x9f\xa2\xf4\x7f\x94\xbf\xe7\x24\x67\xcb\xc5\xaa\xd9\x3d\xe7\xcd\xbd\xcb\xfb\x45\xc2\x25\x44\x35\x4a\x4e\x57\x65\x5d\x50\x42\xc5\xaa\x96\x05\x5c\x47\xcb\x03\x21\x2b\xd2\x3f\x5b\x35\xf5\x4d\xd5\xf2\x84\x7e\xad\xf3\x25\xe1\xc4\xf4\x02\x62\xc7\x28\x31\xd9\x45\x48\xa3\x8d\x5c\xdd\xdc\x79\x50\x4c\xf5\x2d\x67\xea\x82\x26\xac\x2b\x51\xa3\xaa\x32\x39\x2c\x5f\x21\x1b\xeb\x76\x49\xd3\x6b\x0d\xdf\x9d\x47\x78\x73\x73\xb3\x25\xc6\x66\xcc\x4a\x7b\xb8\x94\x5c\xe1\x5b\x21\x08\x11\xe3\x1e\x9a\xcd\x79\xdLine truncated
|
||||
var _confLocaleLocale_enUsIni = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\x7d\xeb\x92\xdc\x46\xae\xe6\x7f\x3e\x05\xad\x0d\xad\xec\x88\x56\x29\x6c\xc7\x5e\xc2\x21\xc9\xdb\xee\xb6\x2e\x73\xd4\x6a\x1d\x75\x6b\x66\x67\x15\x0a\x0e\xab\xc8\xae\xe2\xa8\x8a\x2c\xf3\xd2\xe5\x9e\x5f\xfb\x1a\xfb\x7a\xfb\x24\x0b\x7c\x00\xf2\x42\xb2\x5a\xf2\x9c\x13\x7b\xfe\x54\x25\x33\x91\x37\x24\x12\x09\x20\x91\x99\xf9\x7e\x9f\x15\x65\xb7\x4a\x9f\xa5\xa7\xe9\x3e\xaf\xea\x6d\xd9\x75\x69\x57\x6e\x6f\x1e\x6f\x9a\xae\x2f\x8b\xf4\x65\xd5\xd3\x77\x7b\x5b\xad\xca\x24\xd9\x34\xbb\x92\x40\x5f\xd1\x5f\x52\xe4\xdd\x66\xd9\xe4\x6d\x41\x11\xe7\x16\x4e\xca\xdf\xf7\xdb\xa6\x65\xa0\x5f\x25\x94\x6c\xca\xed\x9e\xf3\xd0\x5f\xd2\x55\xeb\x3a\xab\x6a\xfa\xbc\xa2\x50\xfa\xba\x4e\xba\x66\x55\xe5\xdb\x2c\x48\x40\x84\xa5\xff\x94\xfe\x50\x17\xe9\x55\x5f\xee\xd3\xa7\xdd\x2e\xdf\x6e\x9f\xe7\x1d\xb2\xf4\x65\x9a\xaf\x56\xcd\x50\xf7\x4f\x9f\x48\x82\x14\xde\x0c\xbd\x95\x7e\x39\xf4\x12\x37\xec\x2d\xea\xc3\x3e\x69\xcb\x75\x45\x1d\x6b\x29\xea\xbd\x06\x93\x43\xb9\xec\xaa\x9e\x1b\xfd\x17\x09\x25\xb7\x65\xdb\x55\x0d\xb7\xe7\xcf\x12\x4a\xf6\xf9\x9a\x01\xde\xd1\x5f\xd2\x97\xbb\xfd\x36\x47\x86\x6b\x0d\x26\xdb\xbc\x5e\x0f\x02\xf3\x46\x83\x49\x32\x10\xe6\xea\x1c\x38\xfb\xa0\xc1\xa4\xdc\xe5\xd5\x96\xf1\xf3\x98\x03\x54\x6e\xd7\x1d\x1a\x60\xf1\x9d\x06\xa9\x8d\x59\x7f\xb7\x2f\xd1\xc4\xc7\xd7\x14\x4a\x56\xf9\xbe\x5f\x6d\x72\x8a\x39\x93\x50\x42\x40\xfb\x86\xda\xda\xb4\x77\x80\xb3\x8f\xa4\x69\xd7\x79\x5d\xfd\x23\xef\xa5\xfd\x97\xc1\x67\xb2\xab\xda\xb6\xe1\xae\x5f\x20\x90\xd4\xe5\x21\xe3\x72\x28\xe6\x6d\x79\x08\x4b\xe1\x94\x5d\xb5\x6e\xa5\x97\x9c\x78\x81\x2f\x2e\x85\xd3\x6e\x9a\xf6\xb3\x26\xbc\xe0\xe0\x28\x2b\x35\x42\x53\xe3\xfa\xf3\x9a\xf0\xa2\xa9\x17\xf8\x88\x00\xba\x24\x2f\x76\x55\x9d\xed\xf3\xba\x64\x1c\x9d\xf2\x17\xe1\x85\xbe\x12\x1d\xee\xac\x2b\xfb\xbe\xaa\xd7\x1d\x27\x4b\x54\x7a\xa5\x51\x49\x90\xe6\xe2\xb8\x3d\x5d\x76\x53\x96\x85\xb4\xa8\x4b\x5f\x50\x38\xd9\x0f\xdb\x2d\xf5\xfd\xb7\xa1\xec\x7a\x86\x7f\x47\xdf\xd4\x0b\xf9\x4e\xaa\xae\xa3\x00\x45\xbf\x46\x20\xa1\x01\xa8\x57\x68\xd2\x19\x02\x49\xf2\xb1\x2b\xf3\x76\xb5\xf9\x94\xc8\x3f\x6a\xe4\xc0\x62\xb1\x38\x3a\x34\x4c\x0e\x4a\x0a\x52\x83\x55\x90\xac\x9a\x82\x3f\xce\xe8\x8f\x8a\xae\xea\xae\x27\x92\xfe\x94\x68\x80\xc1\x24\x24\x68\xec\xab\x7e\x5b\xfa\x48\xcc\x8f\x8e\xc7\x21\x7d\x51\xb5\x5d\xff\xb8\xaf\x88\xe4\xde\x0f\x75\xc2\xfd\x23\x72\xce\x8a\xa5\xcd\xf2\x97\x0d\x61\x07\xd1\x2d\xf5\xef\xe2\xee\xea\x5f\xdf\x9c\xa4\xef\x68\xaa\xaf\xdb\x92\xc2\x29\x95\x41\x7f\x94\xe7\xc7\x45\x42\xb9\xac\xa6\xf3\xbc\xcf\x97\x79\x57\x7a\xb4\x72\xa2\xd0\xa8\x4b\x03\xa5\x32\xdb\x00\x8b\xe8\xfa\xa8\xbf\x73\x74\x4e\x65\xe8\xec\x70\x65\xbc\xe5\x29\x42\xf1\xcc\x35\x90\xf9\xdd\xb6\xe4\x78\x2a\x2a\x7d\xfd\xf6\xed\xe5\xf9\x2f\x69\x59\xaf\xab\xba\x4c\x0f\x55\xbf\x49\x87\xfe\xe6\xbf\x67\xeb\xb2\x2e\x5b\x62\x22\xab\x2a\xa5\x99\xd1\x12\x11\xa4\x44\x9e\xd2\xb9\x45\xd2\x75\xdb\x6c\x27\xe8\xbd\xba\x7a\x93\x5e\x30\x8a\xf7\x79\xbf\x41\x43\xfa\x4d\xd2\xfd\xb6\x65\x14\xb9\x0a\xaf\x37\x65\x7a\x53\x51\xaf\x01\xd4\xdc\x18\x3e\xd2\x42\xdb\xb8\x48\xca\xb6\xcd\x68\xde\xf7\x77\x99\x66\xd6\xf2\xc6\x90\x52\x04\x91\x4e\xdd\xf4\xe9\xb2\x4c\x91\x67\x91\x24\xd6\x60\xc3\xee\xe9\x7e\xbf\xad\x56\x32\x63\x5f\x4a\x9a\x47\x34\xb3\x68\xc5\x52\x08\x07\x44\x59\x5a\x80\x2e\xe2\x7f\x77\xcd\xd0\xa6\x11\x1b\x40\xfe\x4d\x49\x7c\x79\x33\xd0\x94\xcb\x89\xa7\x6e\x9b\xa1\xf8\x06\x94\x6a\xad\xf7\x84\x9a\xbe\x6f\xa8\xc1\xc0\x8e\x03\xf0\x55\x9c\x12\xc5\xf1\xaa\xd0\x96\xbb\x86\xb8\x83\x23\xf6\x8a\x08\xea\x50\x51\x22\xf5\xb4\xcb\x6f\x69\xbe\xf5\x4d\xda\x6f\xaa\x2e\x2d\x88\xd8\x56\x5c\x30\x4d\x8d\x81\xf8\xb1\x90\x05\x11\xa8\x90\x86\xc5\xc5\x63\x00\xa8\xdd\x40\xd4\xb4\xa1\xc2\x98\xdb\xf3\xd2\x44\x45\xce\xb5\x13\x5d\xa2\x72\x40\xdf\x44\xb9\x0d\xf1\x56\xe6\x7e\xe7\x08\xe8\x77\x58\x3e\xb5\x2a\xbf\xb9\xa1\x56\x75\x44\x15\xaf\xd2\xd5\xb6\x21\x92\xfa\xf0\xfe\x0d\x65\xde\xf4\xfd\x3e\xdb\x37\x2d\xc8\xf8\xfa\xfa\x1d\x4d\x8f\xb6\xf7\xb1\x01\xae\x19\xa6\x1e\x76\x4b\xfa\x3a\x6c\x2a\x62\x02\x79\x30\x40\x40\xc5\x96\x17\x98\x3a\x6d\xea\x05\xc6\x6a\x68\xb7\xa3\x61\xa4\x2a\x2d\xe5\x48\xf3\xb8\x09\x4f\xf8\xe7\xca\xb7\x12\xdd\xed\x68\x15\x3e\x60\x50\xa9\xab\x25\x56\x13\xa2\xad\x66\xcf\xe5\x06\xc4\x75\xa9\x11\x9e\xa2\xb0\x02\xb9\x74\x59\x87\x28\x15\x6b\x7c\xc0\x4b\x77\xd4\x61\x9d\xcd\x57\x17\x84\x06\x4c\x69\xc4\xde\xb4\xcd\x8e\x62\x5f\xd0\x9f\x8f\xf0\xcd\xbf\xe0\xf2\x00\x93\x17\x05\xb1\x99\xee\x24\x7d\xff\xe2\x2c\xfd\x2f\x3f\xfe\xf0\xc3\x22\x7d\xdd\xf3\x84\x60\x1a\xf9\x3b\x8f\x2d\x05\x65\x41\x74\xa0\x34\x73\x7b\x1a\xfe\x07\x4c\xe0\x0f\xd2\xa7\x48\xfd\x1f\xe5\xef\x39\xad\xb3\xe5\x62\xd5\xec\x9e\xf3\xe4\xde\xe5\xfd\x22\xe1\x14\xa2\x1a\x25\xa7\xab\xb2\x2e\x28\xa0\xcb\xaa\xa6\x05\x5c\x47\xd3\x83\x45\x56\x56\xff\x6c\xd5\xd4\x37\x55\xcb\x1d\xfa\xb5\xce\x97\x84\x13\x93\x0b\x88\x1d\x23\xc5\xd6\x2e\x42\x1a\x4d\xe4\xea\xe6\xce\x83\xa2\xab\x6f\x39\x52\x07\x34\x61\x59\x89\x0a\x55\x91\xc9\x61\xf9\x0a\xd1\x18\xb7\x4b\xea\x5e\x6b\xf8\xee\x3c\xc2\x9b\x9b\x9b\x2d\x31\x36\x63\x56\x5a\xc3\xa5\xc4\x0a\xdf\x0a\x41\x88\x18\xf7\x90\x6c\xce\xaLine 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: 36375, mode: os.FileMode(420), modTime: time.Unix(1439188430, 0)}
|
||||
info := bindataFileInfo{name: "conf/locale/locale_en-US.ini", size: 36551, mode: os.FileMode(420), modTime: time.Unix(1439198919, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -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
|
||||
+89
-60
@@ -2,6 +2,94 @@
|
||||
|
||||
var csrf;
|
||||
|
||||
function initCommentForm() {
|
||||
if ($('.comment.form').length == 0) {
|
||||
return
|
||||
}
|
||||
|
||||
var $form = $('.comment.form');
|
||||
$form.find('.tabular.menu .item').tab();
|
||||
$form.find('.tabular.menu .item[data-tab="preview"]').click(function () {
|
||||
var $this = $(this);
|
||||
$.post($this.data('url'), {
|
||||
"_csrf": csrf,
|
||||
"mode": "gfm",
|
||||
"context": $this.data('context'),
|
||||
"text": $form.find('.tab.segment[data-tab="write"] textarea').val()
|
||||
},
|
||||
function (data) {
|
||||
$form.find('.tab.segment[data-tab="preview"]').html(data);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// Labels
|
||||
var $list = $('.ui.labels.list');
|
||||
var $no_select = $list.find('.no-select');
|
||||
$('.select-label .menu .item:not(.no-select)').click(function () {
|
||||
if ($(this).hasClass('checked')) {
|
||||
$(this).removeClass('checked')
|
||||
$(this).find('.octicon').removeClass('octicon-check')
|
||||
} else {
|
||||
$(this).addClass('checked')
|
||||
$(this).find('.octicon').addClass('octicon-check')
|
||||
}
|
||||
|
||||
var label_ids = "";
|
||||
$(this).parent().find('.item').each(function () {
|
||||
if ($(this).hasClass('checked')) {
|
||||
label_ids += $(this).data('id') + ",";
|
||||
$($(this).data('id-selector')).removeClass('hide');
|
||||
} else {
|
||||
$($(this).data('id-selector')).addClass('hide');
|
||||
}
|
||||
});
|
||||
if (label_ids.length == 0) {
|
||||
$no_select.removeClass('hide');
|
||||
} else {
|
||||
$no_select.addClass('hide');
|
||||
}
|
||||
$($(this).parent().data('id')).val(label_ids);
|
||||
return false;
|
||||
});
|
||||
$('.select-label .menu .no-select.item').click(function () {
|
||||
$(this).parent().find('.item').each(function () {
|
||||
$(this).removeClass('checked');
|
||||
$(this).find('.octicon').removeClass('octicon-check');
|
||||
});
|
||||
|
||||
$list.find('.item').each(function () {
|
||||
$(this).addClass('hide');
|
||||
});
|
||||
$no_select.removeClass('hide');
|
||||
$($(this).parent().data('id')).val('');
|
||||
});
|
||||
|
||||
var $milestone_menu = $('.select-milestone .menu');
|
||||
var $milestone_list = $('.ui.select-milestone.list')
|
||||
// Milestones
|
||||
$milestone_menu.find('.item:not(.no-select)').click(function () {
|
||||
$(this).parent().find('.item').each(function () {
|
||||
$(this).removeClass('selected active')
|
||||
});
|
||||
|
||||
$(this).addClass('selected active');
|
||||
$milestone_list.find('.selected').html('<a class="item" href=' + $(this).data('href') + '>' +
|
||||
$(this).text() + '</a>');
|
||||
$('.ui.select-milestone.list .no-select').addClass('hide');
|
||||
$('#milestone_id').val($(this).data('id'));
|
||||
});
|
||||
$milestone_menu.find('.no-select.item').click(function () {
|
||||
$(this).parent().find('.item:not(.no-select)').each(function () {
|
||||
$(this).removeClass('selected active')
|
||||
});
|
||||
|
||||
$milestone_list.find('.selected').html('');
|
||||
$milestone_list.find('.no-select').removeClass('hide');
|
||||
$('#milestone_id').val('');
|
||||
});
|
||||
}
|
||||
|
||||
function initInstall() {
|
||||
if ($('.install').length == 0) {
|
||||
return;
|
||||
@@ -133,66 +221,6 @@ $(document).ready(function () {
|
||||
});
|
||||
$('.poping.up').popup();
|
||||
|
||||
// Comment form
|
||||
if ($('.comment.form').length > 0) {
|
||||
var $form = $(this);
|
||||
$form.find('.tabular.menu .item').tab();
|
||||
$form.find('.tabular.menu .item[data-tab="preview"]').click(function () {
|
||||
var $this = $(this);
|
||||
$.post($this.data('url'), {
|
||||
"_csrf": csrf,
|
||||
"mode": "gfm",
|
||||
"context": $this.data('context'),
|
||||
"text": $form.find('.tab.segment[data-tab="write"] textarea').val()
|
||||
},
|
||||
function (data) {
|
||||
$form.find('.tab.segment[data-tab="preview"]').html(data);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// Labels
|
||||
var $list = $('.ui.labels.list');
|
||||
var $no_select = $list.find('.no-select');
|
||||
$('.select-label .item:not(.no-select)').click(function () {
|
||||
if ($(this).hasClass('checked')) {
|
||||
$(this).removeClass('checked')
|
||||
$(this).find('.octicon').removeClass('octicon-check')
|
||||
} else {
|
||||
$(this).addClass('checked')
|
||||
$(this).find('.octicon').addClass('octicon-check')
|
||||
}
|
||||
|
||||
var label_ids = "";
|
||||
$(this).parent().find('.item').each(function () {
|
||||
if ($(this).hasClass('checked')) {
|
||||
label_ids += $(this).data('id') + ",";
|
||||
$($(this).data('id-selector')).removeClass('hide');
|
||||
} else {
|
||||
$($(this).data('id-selector')).addClass('hide');
|
||||
}
|
||||
});
|
||||
if (label_ids.length == 0) {
|
||||
$no_select.removeClass('hide');
|
||||
} else {
|
||||
$no_select.addClass('hide');
|
||||
}
|
||||
$($(this).parent().data('id')).val(label_ids);
|
||||
return false;
|
||||
});
|
||||
$('.select-label .no-select.item').click(function () {
|
||||
$(this).parent().find('.item').each(function () {
|
||||
$(this).removeClass('checked');
|
||||
$(this).find('.octicon').removeClass('octicon-check');
|
||||
});
|
||||
|
||||
$list.find('.item').each(function () {
|
||||
$(this).addClass('hide');
|
||||
});
|
||||
$no_select.removeClass('hide');
|
||||
$($(this).parent().data('id')).val('');
|
||||
});
|
||||
}
|
||||
|
||||
// Helpers.
|
||||
$('.delete-button').click(function () {
|
||||
@@ -211,6 +239,7 @@ $(document).ready(function () {
|
||||
return false;
|
||||
});
|
||||
|
||||
initCommentForm();
|
||||
initInstall();
|
||||
initRepository();
|
||||
});
|
||||
@@ -102,7 +102,7 @@ footer {
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none!important;
|
||||
display: none;
|
||||
}
|
||||
.center {
|
||||
text-align: center;
|
||||
|
||||
@@ -29,18 +29,27 @@
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.metas .ui.list {
|
||||
.label.color {
|
||||
padding: 0 8px;
|
||||
margin-right: 5px;
|
||||
.metas {
|
||||
.menu {
|
||||
max-height: 300px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
a {
|
||||
padding-top: 5px;
|
||||
padding-right: 10px;
|
||||
.text {
|
||||
color: #444;
|
||||
&:hover {
|
||||
color: #000;
|
||||
.ui.list {
|
||||
.hide {
|
||||
display: none!important;
|
||||
}
|
||||
.label.color {
|
||||
padding: 0 8px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
a {
|
||||
padding-top: 5px;
|
||||
padding-right: 10px;
|
||||
.text {
|
||||
color: #444;
|
||||
&:hover {
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+42
-20
@@ -190,19 +190,21 @@ func NewIssue(ctx *middleware.Context) {
|
||||
ctx.Handle(500, "GetLabelsByRepoID: %v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// // 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
|
||||
// }
|
||||
ctx.Data["OpenMilestones"], err = models.GetMilestones(repo.ID, -1, false)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetMilestones: %v", err)
|
||||
return
|
||||
}
|
||||
ctx.Data["ClosedMilestones"], err = models.GetMilestones(repo.ID, -1, true)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetMilestones: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
// ctx.Data["AssigneeID"] = 0
|
||||
// ctx.Data["Assignees"], err = repo.GetCollaborators()
|
||||
}
|
||||
|
||||
// us, err := repo.GetCollaborators()
|
||||
// if err != nil {
|
||||
@@ -222,8 +224,9 @@ func NewIssuePost(ctx *middleware.Context, form auth.CreateIssueForm) {
|
||||
ctx.Data["AttachmentAllowedTypes"] = setting.AttachmentAllowedTypes
|
||||
|
||||
var (
|
||||
repo = ctx.Repo.Repository
|
||||
labelIDs []int64
|
||||
repo = ctx.Repo.Repository
|
||||
labelIDs []int64
|
||||
milestoneID int64
|
||||
)
|
||||
if ctx.User.IsAdmin {
|
||||
// Check labels.
|
||||
@@ -244,6 +247,25 @@ func NewIssuePost(ctx *middleware.Context, form auth.CreateIssueForm) {
|
||||
ctx.Data["HasSelectedLabel"] = hasSelected
|
||||
ctx.Data["label_ids"] = form.LabelIDs
|
||||
ctx.Data["Labels"] = labels
|
||||
|
||||
// Check milestone.
|
||||
milestoneID = form.MilestoneID
|
||||
ctx.Data["OpenMilestones"], err = models.GetMilestones(repo.ID, -1, false)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetMilestones: %v", err)
|
||||
return
|
||||
}
|
||||
ctx.Data["ClosedMilestones"], err = models.GetMilestones(repo.ID, -1, true)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetMilestones: %v", err)
|
||||
return
|
||||
}
|
||||
ctx.Data["Milestone"], err = models.GetRepoMilestoneByID(repo.ID, milestoneID)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetRepoMilestoneByID: %v", err)
|
||||
return
|
||||
}
|
||||
ctx.Data["milestone_id"] = milestoneID
|
||||
}
|
||||
|
||||
if ctx.HasError() {
|
||||
@@ -252,11 +274,11 @@ func NewIssuePost(ctx *middleware.Context, form auth.CreateIssueForm) {
|
||||
}
|
||||
|
||||
issue := &models.Issue{
|
||||
RepoID: ctx.Repo.Repository.ID,
|
||||
Index: int64(repo.NumIssues) + 1,
|
||||
Name: form.Title,
|
||||
PosterID: ctx.User.Id,
|
||||
// MilestoneID: form.MilestoneID,
|
||||
RepoID: ctx.Repo.Repository.ID,
|
||||
Index: int64(repo.NumIssues) + 1,
|
||||
Name: form.Title,
|
||||
PosterID: ctx.User.Id,
|
||||
MilestoneID: milestoneID,
|
||||
// AssigneeID: form.AssigneeID,
|
||||
Content: form.Content,
|
||||
}
|
||||
@@ -683,7 +705,7 @@ func UpdateIssueMilestone(ctx *middleware.Context) {
|
||||
|
||||
// Not check for invalid milestone id and give responsibility to owners.
|
||||
issue.MilestoneID = mid
|
||||
if err = models.ChangeMilestoneAssign(oldMid, mid, issue); err != nil {
|
||||
if err = models.ChangeMilestoneAssign(oldMid, issue); err != nil {
|
||||
ctx.Handle(500, "issue.UpdateIssueMilestone(ChangeMilestoneAssign)", err)
|
||||
return
|
||||
} else if err = models.UpdateIssue(issue); err != nil {
|
||||
|
||||
@@ -38,16 +38,16 @@
|
||||
</div>
|
||||
|
||||
{{if .IsRepositoryAdmin}}
|
||||
<input id="label_ids" name="label_ids" type="hidden" value="{{.label_ids}}">
|
||||
<div class="four wide column">
|
||||
<div class="ui segment metas">
|
||||
<input id="label_ids" name="label_ids" type="hidden" value="{{.label_ids}}">
|
||||
<div class="ui {{if not .Labels}}disabled{{end}} jump select-label dropdown">
|
||||
<span class="text">
|
||||
<strong>{{.i18n.Tr "repo.issues.new.labels"}}</strong>
|
||||
<span class="octicon octicon-gear"></span>
|
||||
</span>
|
||||
<div class="filter menu" data-id="#label_ids">
|
||||
<a class="no-select item" href="#">{{.i18n.Tr "repo.issues.new.clear_labels"}}</a>
|
||||
<div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_labels"}}</div>
|
||||
{{range .Labels}}
|
||||
<a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}"><span class="octicon {{if .IsChecked}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a>
|
||||
{{end}}
|
||||
@@ -59,32 +59,59 @@
|
||||
<a class="{{if not .IsChecked}}hide{{end}} item" id="label_{{.ID}}" href="{{$.RepoLink}}/issues?labels={{.ID}}"><span class="label color" style="background-color: {{.Color}}"></span> <span class="text">{{.Name}}</span></a>
|
||||
{{end}}
|
||||
</div>
|
||||
<!-- <div class="ui divider"></div>
|
||||
<div class="ui {{if .Labels}}disabled{{end}} dropdown jump item">
|
||||
|
||||
<div class="ui divider"></div>
|
||||
|
||||
<input id="milestone_id" name="milestone_id" type="hidden" value="{{.milestone_id}}">
|
||||
<div class="ui {{if not (or .OpenMilestones .ClosedMilestones)}}disabled{{end}} jump select-milestone dropdown">
|
||||
<span class="text">
|
||||
<strong>{{.i18n.Tr "repo.issues.new.milestone"}}</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 .IsChecked}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a>
|
||||
<div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_milestone"}}</div>
|
||||
{{if .OpenMilestones}}
|
||||
<div class="divider"></div>
|
||||
<div class="header">
|
||||
<i class="octicon octicon-milestone"></i>
|
||||
{{.i18n.Tr "repo.issues.new.open_milestone"}}
|
||||
</div>
|
||||
{{range .OpenMilestones}}
|
||||
<div class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?milestone={{.ID}}"> {{.Name}}</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{if .ClosedMilestones}}
|
||||
<div class="divider"></div>
|
||||
<div class="header">
|
||||
<i class="octicon octicon-milestone"></i>
|
||||
{{.i18n.Tr "repo.issues.new.closed_milestone"}}
|
||||
</div>
|
||||
{{range .ClosedMilestones}}
|
||||
<a class="item" data-id="{{.ID}}" data-href="{{$.RepoLink}}/issues?milestone={{.ID}}"> {{.Name}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui list">
|
||||
<span class="item">filter_label_no_select</span>
|
||||
<div class="ui select-milestone list">
|
||||
<span class="no-select item {{if .Milestone}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_milestone"}}</span>
|
||||
<div class="selected">
|
||||
{{if .Milestone}}
|
||||
<a class="item" href="{{.RepoLink}}/issues?milestone={{.Milestone.ID}}"> {{.Milestone.Name}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui divider"></div>
|
||||
<div class="ui {{if .Labels}}disabled{{end}} dropdown jump item">
|
||||
|
||||
<!-- <div class="ui divider"></div>
|
||||
|
||||
<div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
|
||||
<span class="text">
|
||||
<strong>{{.i18n.Tr "repo.issues.new.assignee"}}</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 .IsChecked}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a>
|
||||
<div class="item">{{.i18n.Tr "repo.issues.new.clear_assignee"}}</a>
|
||||
{{range .Assignees}}
|
||||
<a class="item" href="#"><span class="octicon {{if eq .ID $.AssigneeID}}octicon-check{{end}}"></span> {{.Name}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user