public/css: adjust width of label color in dropdown

models/issue: unify Issue receiver name to 'issue'
pull/5544/head
Unknwon 2018-12-02 17:54:55 -05:00
parent 29c5be47ed
commit 945a378e55
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
4 changed files with 33 additions and 33 deletions

View File

@ -160,8 +160,8 @@ func (issue *Issue) HTMLURL() string {
} }
// State returns string representation of issue status. // State returns string representation of issue status.
func (i *Issue) State() api.StateType { func (issue *Issue) State() api.StateType {
if i.IsClosed { if issue.IsClosed {
return api.STATE_CLOSED return api.STATE_CLOSED
} }
return api.STATE_OPEN return api.STATE_OPEN
@ -208,22 +208,22 @@ func (issue *Issue) APIFormat() *api.Issue {
} }
// HashTag returns unique hash tag for issue. // HashTag returns unique hash tag for issue.
func (i *Issue) HashTag() string { func (issue *Issue) HashTag() string {
return "issue-" + com.ToStr(i.ID) return "issue-" + com.ToStr(issue.ID)
} }
// IsPoster returns true if given user by ID is the poster. // IsPoster returns true if given user by ID is the poster.
func (i *Issue) IsPoster(uid int64) bool { func (issue *Issue) IsPoster(uid int64) bool {
return i.PosterID == uid return issue.PosterID == uid
} }
func (i *Issue) hasLabel(e Engine, labelID int64) bool { func (issue *Issue) hasLabel(e Engine, labelID int64) bool {
return hasIssueLabel(e, i.ID, labelID) return hasIssueLabel(e, issue.ID, labelID)
} }
// HasLabel returns true if issue has been labeled by given ID. // HasLabel returns true if issue has been labeled by given ID.
func (i *Issue) HasLabel(labelID int64) bool { func (issue *Issue) HasLabel(labelID int64) bool {
return i.hasLabel(x, labelID) return issue.hasLabel(x, labelID)
} }
func (issue *Issue) sendLabelUpdatedWebhook(doer *User) { func (issue *Issue) sendLabelUpdatedWebhook(doer *User) {
@ -255,8 +255,8 @@ func (issue *Issue) sendLabelUpdatedWebhook(doer *User) {
} }
} }
func (i *Issue) addLabel(e *xorm.Session, label *Label) error { func (issue *Issue) addLabel(e *xorm.Session, label *Label) error {
return newIssueLabel(e, i, label) return newIssueLabel(e, issue, label)
} }
// AddLabel adds a new label to the issue. // AddLabel adds a new label to the issue.
@ -389,12 +389,12 @@ func (issue *Issue) ReplaceLabels(labels []*Label) (err error) {
return sess.Commit() return sess.Commit()
} }
func (i *Issue) GetAssignee() (err error) { func (issue *Issue) GetAssignee() (err error) {
if i.AssigneeID == 0 || i.Assignee != nil { if issue.AssigneeID == 0 || issue.Assignee != nil {
return nil return nil
} }
i.Assignee, err = GetUserByID(i.AssigneeID) issue.Assignee, err = GetUserByID(issue.AssigneeID)
if errors.IsUserNotExist(err) { if errors.IsUserNotExist(err) {
return nil return nil
} }
@ -402,8 +402,8 @@ func (i *Issue) GetAssignee() (err error) {
} }
// ReadBy sets issue to be read by given user. // ReadBy sets issue to be read by given user.
func (i *Issue) ReadBy(uid int64) error { func (issue *Issue) ReadBy(uid int64) error {
return UpdateIssueUserByRead(uid, i.ID) return UpdateIssueUserByRead(uid, issue.ID)
} }
func updateIssueCols(e Engine, issue *Issue, cols ...string) error { func updateIssueCols(e Engine, issue *Issue, cols ...string) error {
@ -416,41 +416,41 @@ func UpdateIssueCols(issue *Issue, cols ...string) error {
return updateIssueCols(x, issue, cols...) return updateIssueCols(x, issue, cols...)
} }
func (i *Issue) changeStatus(e *xorm.Session, doer *User, repo *Repository, isClosed bool) (err error) { func (issue *Issue) changeStatus(e *xorm.Session, doer *User, repo *Repository, isClosed bool) (err error) {
// Nothing should be performed if current status is same as target status // Nothing should be performed if current status is same as target status
if i.IsClosed == isClosed { if issue.IsClosed == isClosed {
return nil return nil
} }
i.IsClosed = isClosed issue.IsClosed = isClosed
if err = updateIssueCols(e, i, "is_closed"); err != nil { if err = updateIssueCols(e, issue, "is_closed"); err != nil {
return err return err
} else if err = updateIssueUsersByStatus(e, i.ID, isClosed); err != nil { } else if err = updateIssueUsersByStatus(e, issue.ID, isClosed); err != nil {
return err return err
} }
// Update issue count of labels // Update issue count of labels
if err = i.getLabels(e); err != nil { if err = issue.getLabels(e); err != nil {
return err return err
} }
for idx := range i.Labels { for idx := range issue.Labels {
if i.IsClosed { if issue.IsClosed {
i.Labels[idx].NumClosedIssues++ issue.Labels[idx].NumClosedIssues++
} else { } else {
i.Labels[idx].NumClosedIssues-- issue.Labels[idx].NumClosedIssues--
} }
if err = updateLabel(e, i.Labels[idx]); err != nil { if err = updateLabel(e, issue.Labels[idx]); err != nil {
return err return err
} }
} }
// Update issue count of milestone // Update issue count of milestone
if err = changeMilestoneIssueStats(e, i); err != nil { if err = changeMilestoneIssueStats(e, issue); err != nil {
return err return err
} }
// New action comment // New action comment
if _, err = createStatusComment(e, doer, repo, i); err != nil { if _, err = createStatusComment(e, doer, repo, issue); err != nil {
return err return err
} }

View File

@ -1,6 +1,6 @@
{ {
"CodeKitInfo": "This is a CodeKit 2.x project configuration file. It is designed to sync project settings across multiple machines. MODIFYING THE CONTENTS OF THIS FILE IS A POOR LIFE DECISION. If you do so, you will likely cause CodeKit to crash. This file is not useful unless accompanied by the project that created it in CodeKit 2. This file is not backwards-compatible with CodeKit 1.x. For more information, see: http:\/\/incident57.com\/codekit", "CodeKitInfo": "This is a CodeKit 2.x project configuration file. It is designed to sync project settings across multiple machines. MODIFYING THE CONTENTS OF THIS FILE IS A POOR LIFE DECISION. If you do so, you will likely cause CodeKit to crash. This file is not useful unless accompanied by the project that created it in CodeKit 2. This file is not backwards-compatible with CodeKit 1.x. For more information, see: http:\/\/incident57.com\/codekit",
"creatorBuild": "19115", "creatorBuild": "19127",
"files": { "files": {
"\/css\/github.min.css": { "\/css\/github.min.css": {
"fileType": 16, "fileType": 16,

View File

@ -1211,7 +1211,7 @@ footer .ui.language .menu {
.repository .filter.menu .label.color { .repository .filter.menu .label.color {
border-radius: 3px; border-radius: 3px;
margin-left: 15px; margin-left: 15px;
padding: 0 8px; padding: 0 10px;
} }
.repository .filter.menu .octicon { .repository .filter.menu .octicon {
float: left; float: left;

View File

@ -91,7 +91,7 @@
.label.color { .label.color {
border-radius: 3px; border-radius: 3px;
margin-left: 15px; margin-left: 15px;
padding: 0 8px; padding: 0 10px;
} }
.octicon { .octicon {
float: left; float: left;