Skip to content

Commit

Permalink
Remove Hashtag Code from Build (go-gitea#166)
Browse files Browse the repository at this point in the history
* Remove Hashtag Code from Build

Hashtag code was added prematurely.

feature/Issue-162

* removed reference to db
  • Loading branch information
bspidel authored and Phil Hopper committed Apr 9, 2017
1 parent a3968fc commit 5fa9875
Show file tree
Hide file tree
Showing 16 changed files with 7 additions and 332 deletions.
14 changes: 0 additions & 14 deletions cmd/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,20 +414,6 @@ func runWeb(ctx *cli.Context) error {
Post(bindIgnErr(auth.CreateRepoForm{}), repo.ForkPost)
}, reqSignIn)

// Check for hashtag requests in UBN repositories.
// => repo name must contain `-ubn-` or end with `-ubn`.
m.Group("/:username/:reponame(.+-ubn-.+|.+-ubn$)", func() {
m.Get("/hashtags", repo.Hashtags)
m.Get("/hashtags/:hashtag", repo.HashtagDisambiguation)
}, ignSignIn, context.RepoAssignment(), context.RepoRef())

// Redirect hashtag requests for ineligible repositories
m.Group("/:username/:reponame", func() {
m.Get("/hashtags/*.*", func(ctx *macaron.Context) {
ctx.Redirect(setting.AppSubURL + "/" + ctx.Params(":username")+ "/" + ctx.Params(":reponame"), 301)
})
}, ignSignIn)

m.Group("/:username/:reponame", func() {
m.Group("/settings", func() {
m.Combo("").Get(repo.Settings).
Expand Down
31 changes: 0 additions & 31 deletions models/fixtures/hashtag.yml

This file was deleted.

64 changes: 0 additions & 64 deletions models/hashtag.go

This file was deleted.

20 changes: 0 additions & 20 deletions models/hashtag_test.go

This file was deleted.

5 changes: 0 additions & 5 deletions models/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,6 @@ func (issue *Issue) APIFormat() *api.Issue {
return apiIssue
}

// HashTag returns unique hash tag for issue.
func (issue *Issue) HashTag() string {
return "issue-" + com.ToStr(issue.ID)
}

// IsPoster returns true if given user by ID is the poster.
func (issue *Issue) IsPoster(uid int64) bool {
return issue.PosterID == uid
Expand Down
5 changes: 0 additions & 5 deletions models/issue_comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,6 @@ func (c *Comment) APIFormat() *api.Comment {
}
}

// HashTag returns unique hash tag for comment.
func (c *Comment) HashTag() string {
return "issuecomment-" + com.ToStr(c.ID)
}

// EventTag returns unique event hash tag for comment.
func (c *Comment) EventTag() string {
return "event-" + com.ToStr(c.ID)
Expand Down
1 change: 0 additions & 1 deletion models/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ func init() {
new(RepoRedirect),
new(ExternalLoginUser),
new(ProtectedBranch),
new(Hashtag),
)

gonicNames := []string{"SSL", "UID"}
Expand Down
24 changes: 0 additions & 24 deletions modules/hashtag/hashtag.go

This file was deleted.

87 changes: 0 additions & 87 deletions modules/hashtag/hashtag_test.go

This file was deleted.

3 changes: 0 additions & 3 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,6 @@ mirror_last_synced = Last Synced
watchers = Watchers
stargazers = Stargazers
forks = Forks
hashtags = Hashtags

form.reach_limit_of_creation = You have reached your maximum creation limit of %d repositories.
form.name_reserved = The repository name '%s' is reserved.
Expand Down Expand Up @@ -899,8 +898,6 @@ release.tag_name_already_exist = Release with this tag name already exists.
release.tag_name_invalid = Tag name is not valid.
release.downloads = Downloads

hashtag.all_hashtags = Hashtags in %s repositories

branch.delete = Delete Branch %s
branch.delete_desc = Once you delete a branch, there is no going back. Please be certain.
branch.delete_notices_1 = - This operation <strong>CANNOT</strong> be undone.
Expand Down
49 changes: 0 additions & 49 deletions routers/repo/hashtag.go

This file was deleted.

7 changes: 2 additions & 5 deletions routers/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -865,11 +865,8 @@ func NewComment(ctx *context.Context, form auth.CreateCommentForm) {
if issue.IsPull {
typeName = "pulls"
}
if comment != nil {
ctx.Redirect(fmt.Sprintf("%s/%s/%d#%s", ctx.Repo.RepoLink, typeName, issue.Index, comment.HashTag()))
} else {
ctx.Redirect(fmt.Sprintf("%s/%s/%d", ctx.Repo.RepoLink, typeName, issue.Index))
}

ctx.Redirect(fmt.Sprintf("%s/%s/%d", ctx.Repo.RepoLink, typeName, issue.Index))
}()

// Fix #321: Allow empty comments, as long as we have attachments.
Expand Down
3 changes: 0 additions & 3 deletions routers/repo/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/hashtag"
"code.gitea.io/gitea/modules/highlight"
"code.gitea.io/gitea/modules/lfs"
"code.gitea.io/gitea/modules/log"
Expand Down Expand Up @@ -92,7 +91,6 @@ func renderDirectory(ctx *context.Context, treeLink string) {
case markdown.IsMarkdownFile(readmeFile.Name()):
ctx.Data["IsMarkdown"] = true
buf = markdown.Render(buf, treeLink, ctx.Repo.Repository.ComposeMetas())
buf = hashtag.ConvertHashtagsToLinks(ctx.Repo.Repository, buf)
default:
// FIXME This is the only way to show non-markdown files
// instead of a broken "View Raw" link
Expand Down Expand Up @@ -196,7 +194,6 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
// TODO: don't need to render if it's a README but not Markdown file.
yamlHtml := yaml.RenderMarkdownYaml(buf)
markdownBody := markdown.Render(yaml.StripYamlFromText(buf), path.Dir(treeLink), ctx.Repo.Repository.ComposeMetas())
markdownBody = hashtag.ConvertHashtagsToLinks(ctx.Repo.Repository, markdownBody)
ctx.Data["FileContent"] = string(append(yamlHtml, markdownBody...))
case isYaml:
rendered, err := yaml.RenderYaml(buf)
Expand Down
Loading

0 comments on commit 5fa9875

Please sign in to comment.