summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-20 04:31:28 +0800
committerUnknwon <u@gogs.io>2015-08-20 04:31:28 +0800
commit371572cf5f853211fb11bb28bc41658119d3e247 (patch)
tree68530957b87dbc2f659d4a155bbec41bb557c033 /templates
parentf114f7874303d249b2956c894b1a90b042430acf (diff)
downloadgitea-371572cf5f853211fb11bb28bc41658119d3e247.tar.gz
gitea-371572cf5f853211fb11bb28bc41658119d3e247.zip
allow edit issue and comment
Diffstat (limited to 'templates')
-rw-r--r--templates/.VERSION2
-rw-r--r--templates/repo/issue/comment_tab.tmpl4
-rw-r--r--templates/repo/issue/view_content.tmpl59
3 files changed, 48 insertions, 17 deletions
diff --git a/templates/.VERSION b/templates/.VERSION
index bd3cf2cb27..53bfc6cafa 100644
--- a/templates/.VERSION
+++ b/templates/.VERSION
@@ -1 +1 @@
-0.6.5.0819 Beta \ No newline at end of file
+0.6.5.0820 Beta \ No newline at end of file
diff --git a/templates/repo/issue/comment_tab.tmpl b/templates/repo/issue/comment_tab.tmpl
index 5e61e575c6..d6f71e649f 100644
--- a/templates/repo/issue/comment_tab.tmpl
+++ b/templates/repo/issue/comment_tab.tmpl
@@ -1,7 +1,7 @@
<div class="field">
- <div class="ui top attached tabular menu">
+ <div class="ui top attached tabular menu" data-write="write" data-preview="preview">
<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>
+ <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 id="content" name="content"></textarea>
diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl
index 1b1c035b4b..ad3c471bbe 100644
--- a/templates/repo/issue/view_content.tmpl
+++ b/templates/repo/issue/view_content.tmpl
@@ -50,16 +50,20 @@
<span class="text grey"><a {{if gt .Issue.Poster.Id 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.Name}}</a> {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}}</span>
<div class="ui right actions">
{{if .IsIssueOwner}}
- <a class="item" href="#"><i class="octicon octicon-pencil"></i></a>
+ <a class="edit-content item" href="#"><i class="octicon octicon-pencil"></i></a>
{{end}}
</div>
</div>
- <div class="ui attached segment markdown">
- {{if .Issue.RenderedContent}}
- {{.Issue.RenderedContent|Str2html}}
- {{else}}
- <span class="no-content">{{.i18n.Tr "repo.issues.no_content"}}</span>
- {{end}}
+ <div class="ui attached segment">
+ <div class="render-content markdown">
+ {{if .Issue.RenderedContent}}
+ {{.Issue.RenderedContent|Str2html}}
+ {{else}}
+ <span class="no-content">{{.i18n.Tr "repo.issues.no_content"}}</span>
+ {{end}}
+ </div>
+ <div class="raw-content hide">{{.Issue.Content}}</div>
+ <div class="edit-content-zone hide" data-write="issue-{{.Issue.ID}}-write" data-preview="issue-{{.Issue.ID}}-preview" data-update-url="{{.Link}}/content" data-context="{{.RepoLink}}"></div>
</div>
{{if .Issue.Attachments}}
<div class="ui bottom attached segment">
@@ -98,16 +102,20 @@
</div>
{{end}}
{{if or $.IsRepositoryAdmin (eq .Poster.Id $.SignedUserID)}}
- <a class="item" href="#"><i class="octicon octicon-pencil"></i></a>
+ <a class="edit-content item" href="#" data-type="comment"><i class="octicon octicon-pencil"></i></a>
{{end}}
</div>
</div>
- <div class="ui attached segment markdown">
- {{if .RenderedContent}}
- {{.RenderedContent|Str2html}}
- {{else}}
- <span class="no-content">{{$.i18n.Tr "repo.issues.no_content"}}</span>
- {{end}}
+ <div class="ui attached segment">
+ <div class="render-content markdown">
+ {{if .RenderedContent}}
+ {{.RenderedContent|Str2html}}
+ {{else}}
+ <span class="no-content">{{$.i18n.Tr "repo.issues.no_content"}}</span>
+ {{end}}
+ </div>
+ <div class="raw-content hide">{{.Content}}</div>
+ <div class="edit-content-zone hide" data-write="issuecomment-{{.ID}}-write" data-preview="issuecomment-{{.ID}}-preview" data-update-url="{{$.RepoLink}}/comments/{{.ID}}" data-context="{{$.RepoLink}}"></div>
</div>
{{if .Attachments}}
<div class="ui bottom attached segment">
@@ -264,4 +272,27 @@
</div>
</div>
</div>
+</div>
+
+<div class="hide" id="edit-content-form">
+ <div class="ui comment form">
+ <div class="ui top attached tabular menu">
+ <a class="active write item">{{$.i18n.Tr "repo.release.write"}}</a>
+ <a class="preview item" data-url="/api/v1/markdown" data-context="{{$.RepoLink}}">{{$.i18n.Tr "repo.release.preview"}}</a>
+ </div>
+ <div class="ui bottom attached active write tab segment">
+ <textarea id="content" name="content"></textarea>
+ </div>
+ <div class="ui bottom attached tab preview segment markdown">
+ {{$.i18n.Tr "repo.release.loading"}}
+ </div>
+ <div class="text right edit buttons">
+ <div class="ui basic blue cancel button">{{.i18n.Tr "repo.issues.cancel"}}</div>
+ <div class="ui green save button">{{.i18n.Tr "repo.issues.save"}}</div>
+ </div>
+ </div>
+</div>
+
+<div class="hide" id="no-content">
+ <span class="no-content">{{.i18n.Tr "repo.issues.no_content"}}</span>
</div> \ No newline at end of file