able edit issue title

This commit is contained in:
Unknwon 2015-08-19 23:14:57 +08:00
parent a35911486f
commit 87f5ca8e1f
13 changed files with 251 additions and 168 deletions

View file

@ -467,7 +467,7 @@ func runWeb(ctx *cli.Context) {
m.Combo("/:index/comments").Post(bindIgnErr(auth.CreateCommentForm{}), repo.NewComment)
m.Group("/:index", func() {
m.Post("", bindIgnErr(auth.CreateIssueForm{}), repo.UpdateIssue)
m.Post("/title", repo.UpdateIssueTitle)
m.Post("/label", repo.UpdateIssueLabel)
m.Post("/milestone", repo.UpdateIssueMilestone)
m.Post("/assignee", repo.UpdateIssueAssignee)

View file

@ -435,6 +435,7 @@ issues.owner = Owner
issues.sign_up_for_free = Sign up for free
issues.sign_in_require_desc = to join this conversation. Already have an account? <a href="%s">Sign in to comment</a>
issues.edit = Edit
issues.cancel = Cancel
issues.save = Save
issues.label_title = Label name
issues.label_color = Label color

View file

@ -14,9 +14,9 @@ version=Versie
page=Pagina
template=Sjabloon
language=Taal
create_new=Create new...
user_profile_and_more=User profile and more
signed_in_as=Signed in as
create_new=Maak een nieuwe...
user_profile_and_more=Gebruikersprofiel en meer
signed_in_as=Aangemeld als
username=Gebruikersnaam
email=E-mail
@ -35,8 +35,8 @@ manage_org=Beheer organisaties
admin_panel=Adminpaneel
account_settings=Accountinstellingen
settings=Instellingen
your_profile=Your Profile
your_settings=Your Settings
your_profile=Uw profiel
your_settings=Uw instellingen
news_feed=Nieuwsfeed
pull_requests=Pull-aanvragen
@ -76,6 +76,8 @@ run_user=Uitvoerende gebruikersnaam
run_user_helper=Deze gebruiker moet toegang hebben tot de git repositorie directorie en moet Gogs kunnen starten
domain=Domein
domain_helper=Dit heeft invloed op de SSH kloon URLs
ssh_port=SSH Port
ssh_port_helper=Port number which your SSH server is using, leave it empty to disable SSH feature.
http_port=HTTP-poort
http_port_helper=Poortnummer waar het programma naar luistert.
app_url=Applicatie URL
@ -268,16 +270,17 @@ add_key=Sleutel toevoegen
ssh_desc=Dit is een lijst van alle SSH sleutels die gekoppeld zijn aan uw account. Verwijder alle sleutels die u niet herkent.
ssh_helper=<strong>De behoeftehulp van?</strong> Check out onze gids voor het <a href="%s"> genereren van SSH sleutels</a> of <a href="%s"> algemene SSH</a> problemen.
add_new_key=SSH sleutel toevoegen
ssh_key_been_used=Public key content has been used.
ssh_key_name_used=Public key with same name has already existed.
ssh_key_been_used=Publieke sleutel werd gebruikt.
ssh_key_name_used=Een publieke sleutel met dezelfde naam bestaat al.
key_name=Sleutel naam
key_content=Inhoud
add_key_success=New SSH key '%s' has been added successfully!
add_key_success=Nieuwe SSH sleutel '%s' werd met succes toegevoegd!
delete_key=Verwijder
add_on=Toegevoegd op
last_used=Laatst gebruikt op
no_activity=Geen recente activiteiten
key_state_desc=This key is used in last 7 days
key_state_desc=Deze sleutel werd gebruikt in de laatste 7 dagen
token_state_desc=This token is used in last 7 days
manage_social=Beheer gekoppelde sociale accounts
social_desc=Dit is een lijst van de bijbehorende sociale accounts koppelingen, Verwijder eventueel koppelingen die u niet herkent.
@ -286,13 +289,15 @@ unbind_success=Sociaal account is ontkoppeld.
manage_access_token=Persoonlijke toegangstokens beheren
generate_new_token=Nieuwe Token genereren
tokens_desc=Tokens u hebt gegenereerd die kunnen worden gebruikt voor toegang tot de API Gogs.
tokens_desc=Tokens you have generated that can be used to access the Gogs APIs.
new_token_desc=Zoals voor nu, moet elke token zal hebben volledige toegang tot uw account.
token_name=Symbolische naam
generate_token=Token genereren
generate_token_succees=Nieuwe toegangstoken is met succes gegenereerd! Zorg ervoor dat uw nieuwe persoonlijke toegangstoken nu kopiëren. U zal niet zitten kundig voor zien het weer!
delete_token=Verwijderen
delete_token_success=Persoonlijke toegangstoken is met succes verwijderd! Vergeet niet uw toepassingen ook wilt bijwerken.
access_token_deletion=Personal Access Token Deletion
access_token_deletion_desc=Delete this personal access token will remove all related accesses of application. Do you want to continue?
delete_token_success=Personal access token has been removed successfully! Don't forget to update your application as well.
delete_account=Verwijder uw account
delete_prompt=Deze handeling zal uw account definitief verwijderen, u kunt dit <strong> NIET </strong> terug draaien!
@ -305,7 +310,7 @@ owner=Eigenaar
repo_name=Repositorie naam
repo_name_helper=Een goede repositorie naam is kort, memorabel en <strong>uniek</strong>.
visibility=Zichtbaarheid
visiblity_helper=This repository is <span class="ui red text">Private</span>
visiblity_helper=Deze repositorie is <span class="ui red text">privaat</span>
fork_repo=Vork Repository
fork_from=Afsplitsing van
fork_visiblity_helper=Gevorkte repository wijzigen zijn bereik potentiële kopers niet
@ -324,10 +329,10 @@ form.name_pattern_not_allowed=Repositorie naampatroon '%s' is niet toegestaan.
need_auth=Autorisatie vereist
migrate_type=Migratie type
migrate_type_helper=This repository will be a <span class="text blue">mirror</span>
migrate_type_helper=Deze repositorie zal een <span class="text blue">mirror</span> zijn
migrate_repo=Migreer repositorie
migrate.clone_address=Clone adres
migrate.clone_address_desc=This can be a HTTP/HTTPS/GIT URL or local server path.
migrate.clone_address_desc=Dit kan een HTTP/HTTPS/GIT URL zijn of een lokaal pad.
migrate.invalid_local_path=Ongeldig lokaal pad, het pad bestaat niet of het is geen map.
forked_from=geforked van
@ -372,103 +377,103 @@ commits.date=Datum
commits.older=Ouder
commits.newer=Nieuwer
issues.new=New Issue
issues.new=Nieuw probleem
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.clear_assignee=Clear assignee
issues.new.no_assignee=No assignee
issues.create=Create Issue
issues.new.no_label=Geen label
issues.new.clear_labels=Verwijder labels
issues.new.milestone=Mijlpaal
issues.new.no_milestone=Geen mijlpaal
issues.new.clear_milestone=Verwijder mijlpaal
issues.new.open_milestone=Open mijlpalen
issues.new.closed_milestone=Gesloten mijlpalen
issues.new.assignee=Verantwoordelijke
issues.new.clear_assignee=Verwijder verantwoordelijke
issues.new.no_assignee=Geen verantwoordelijke
issues.create=Maak probleem
issues.new_label=Nieuw Label
issues.new_label_placeholder=Tekst label...
issues.create_label=Create Label
issues.create_label=Maak label
issues.open_tab=%d Open
issues.close_tab=%d gesloten
issues.filter_label=Label
issues.filter_label_no_select=Geen label geselecteerd
issues.filter_milestone=Mijlpaal
issues.filter_milestone_no_select=No selected milestone
issues.filter_milestone_no_select=Geen geselecteerde mijlpaal
issues.filter_assignee=Aangewezene
issues.filter_assginee_no_select=No selected Assignee
issues.filter_assginee_no_select=Geen geselecteerde verantwoordelijke
issues.filter_type=Type
issues.filter_type.all_issues=Alle kwesties
issues.filter_type.assigned_to_you=Aan jou toegewezen
issues.filter_type.created_by_you=Created by you
issues.filter_type.mentioning_you=Mentioning you
issues.filter_sort=Sort
issues.filter_sort.latest=Newest
issues.filter_sort.oldest=Oldest
issues.filter_sort.recentupdate=Recently updated
issues.filter_sort.leastupdate=Least recently updated
issues.filter_sort.mostcomment=Most commented
issues.filter_sort.leastcomment=Least commented
issues.opened_by=opened %[1]s by <a href="/%[2]s">%[2]s</a>
issues.opened_by_fake=opened %[1]s by %[2]s
issues.previous=Previous
issues.next=Next
issues.filter_type.created_by_you=Aangemaakt door jou
issues.filter_type.mentioning_you=Vermelden jou
issues.filter_sort=Sorteer
issues.filter_sort.latest=Nieuwste
issues.filter_sort.oldest=Oudste
issues.filter_sort.recentupdate=Recent bijgewerkt
issues.filter_sort.leastupdate=Minst recent bijgewerkt
issues.filter_sort.mostcomment=Meest besproken
issues.filter_sort.leastcomment=Minst besproken
issues.opened_by=%[1]s werd geopend door <a href="/%[2]s">%[2]s</a>
issues.opened_by_fake=%[1]s werd geopend door %[2]s
issues.previous=Vorige
issues.next=Volgende
issues.open_title=Open
issues.closed_title=Closed
issues.num_comments=%d comments
issues.commented_at=`commented at <a id="%[1]s" href="#%[1]s">%[2]s</a>`
issues.no_content=There is no content yet.
issues.close_issue=Close
issues.close_comment_issue=Close and comment
issues.reopen_issue=Reopen
issues.reopen_comment_issue=Reopen and comment
issues.create_comment=Comment
issues.closed_at=`closed at <a id="%[1]s" href="#%[1]s">%[2]s</a>`
issues.reopened_at=`reopened at <a id="%[1]s" href="#%[1]s">%[2]s</a>`
issues.closed_title=Gesloten
issues.num_comments=%d opmerkingen
issues.commented_at=`gaf commentaar op <a id="%[1]s" href="#%[1]s">%[2]s</a>`
issues.no_content=Er is nog geen inhoud.
issues.close_issue=Sluit
issues.close_comment_issue=Sluit en geef commentaar
issues.reopen_issue=Heropen
issues.reopen_comment_issue=Heropen en geef commentaar
issues.create_comment=Reageer
issues.closed_at=`gesloten om <a id="%[1]s" href="#%[1]s">%[2]s</a>`
issues.reopened_at=`heropend om <a id="%[1]s" href="#%[1]s">%[2]s</a>`
issues.poster=Poster
issues.admin=Admin
issues.owner=Owner
issues.sign_up_for_free=Sign up for free
issues.sign_in_require_desc=to join this conversation. Already have an account? <a href="%s">Sign in to comment</a>
issues.edit=Edit
issues.save=Save
issues.label_title=Label name
issues.label_color=Label color
issues.owner=Eigenaar
issues.sign_up_for_free=Gratis aanmelden
issues.sign_in_require_desc=om deel te nemen in deze conversatie. Heeft u al een account? <a href="%s">Meld u aan om te reageren</a>
issues.edit=Bewerken
issues.save=Opslaan
issues.label_title=Labelnaam
issues.label_color=Labelkleur
issues.label_count=%d labels
issues.label_open_issues=%d open issues
issues.label_edit=Edit
issues.label_delete=Delete
issues.label_modify=Label Modification
issues.label_deletion=Label Deletion
issues.label_deletion_desc=Delete this label will remove its information in all related issues. Do you want to continue?
issues.label_deletion_success=Label has been deleted successfully!
issues.label_open_issues=%d geopende problemen
issues.label_edit=Bewerken
issues.label_delete=Verwijder
issues.label_modify=Wijzig label
issues.label_deletion=Verwijder label
issues.label_deletion_desc=Het verwijderen van dit label zal alle informatie in de gerelateerde problemen verwijderen. Wilt u doorgaan?
issues.label_deletion_success=Label werd met succes verwijderd!
pulls.compare_changes=Compare Changes
pulls.compare_changes_desc=Compare two branches and make a pull request for changes.
pulls.no_results=No results found.
pulls.compare_changes=Vergelijk veranderingen
pulls.compare_changes_desc=Vergelijk twee vertakkingen en maak een pull verzoek voor wijzigingen.
pulls.no_results=Geen resultaten gevonden.
milestones.new=New Milestone
milestones.open_tab=%d Open
milestones.close_tab=%d Closed
milestones.closed=Closed %s
milestones.no_due_date=No due date
milestones.new=Nieuwe mijlpaal
milestones.open_tab=%d geopend
milestones.close_tab=%d gesloten
milestones.closed=%s werd gesloten
milestones.no_due_date=Geen vervaldatum
milestones.open=Open
milestones.close=Close
milestones.new_subheader=Create milestones to organize your issues.
milestones.create=Create Milestone
milestones.title=Title
milestones.desc=Description
milestones.due_date=Due Date (optional)
milestones.clear=Clear
milestones.invalid_due_date_format=Due date format is invalid, must be 'year-mm-dd'.
milestones.create_success=Milestone '%s' has been created successfully!
milestones.edit=Edit Milestone
milestones.edit_subheader=Use better description for milestones so people won't be confused.
milestones.cancel=Cancel
milestones.modify=Modify Milestone
milestones.edit_success=Changes of milestone '%s' has been saved successfully!
milestones.deletion=Milestone Deletion
milestones.deletion_desc=Delete this milestone will remove its information in all related issues. Do you want to continue?
milestones.deletion_success=Milestone has been deleted successfully!
milestones.close=Sluit
milestones.new_subheader=Maak mijlpalen voor het organiseren van uw problemen.
milestones.create=Mijlpaal maken
milestones.title=Titel
milestones.desc=Beschrijving
milestones.due_date=Vervaldatum (optioneel)
milestones.clear=Leegmaken
milestones.invalid_due_date_format=Formaat vervaldatum is ongeldig, moet zijn "jaar-mm-dd".
milestones.create_success=Mijlpaal '%s' is met succes aangemaakt!
milestones.edit=Bewerk mijlpaal
milestones.edit_subheader=Gebruik een goede beschrijving voor mijlpalen, om verwarring te voorkomen.
milestones.cancel=Annuleer
milestones.modify=Mijlpaal wijzigen
milestones.edit_success=Wijzigingen van mijlpaal '%s' is met succes opgeslagen!
milestones.deletion=Mijlpaal verwijderen
milestones.deletion_desc=Het verwijderen van dit label zal alle informatie in de gerelateerde problemen verwijderen. Wilt u doorgaan?
milestones.deletion_success=Mijlpaal is met succes verwijderd!
settings=Instellingen
settings.options=Opties
@ -523,16 +528,16 @@ settings.slack_token=Slack token
settings.slack_domain=Slack domein
settings.slack_channel=Slack kanaal
settings.deploy_keys=Installeer sleutels
settings.add_deploy_key=Add Deploy Key
settings.no_deploy_keys=You haven't added any deploy key.
settings.title=Title
settings.deploy_key_content=Content
settings.key_been_used=Deploy key content has been used.
settings.key_name_used=Deploy key with same name has already existed.
settings.add_key_success=New deploy key '%s' has been added successfully!
settings.deploy_key_deletion=Delete Deploy Key
settings.deploy_key_deletion_desc=Delete this deploy key will remove all related accesses for this repository. Do you want to continue?
settings.deploy_key_deletion_success=Deploy key has been deleted successfully!
settings.add_deploy_key=Toevoegen deploy sleutel
settings.no_deploy_keys=U hebt nog geen deploy sleutels toegevoegd.
settings.title=Titel
settings.deploy_key_content=Inhoud
settings.key_been_used=Deploy sleutel inhoud werd gebruikt.
settings.key_name_used=Deploy sleutel met eenzelfde naam bestaat al.
settings.add_key_success=Nieuwe deploy sleutel '%s' werd succesvol toegevoegd!
settings.deploy_key_deletion=Verwijder deploy sleutel
settings.deploy_key_deletion_desc=Het verwijderen van deze deploy sleutel zal alle gerelateerde toegang verwijderen voor deze repositorie. Wilt u doorgaan?
settings.deploy_key_deletion_success=Deploy sleutel werd met succes verwijderd!
diff.browse_source=Bladeren bron
diff.parent=bovenliggende
@ -751,12 +756,14 @@ auths.auth_name=Autorisatienaam
auths.domain=Domein
auths.host=Host
auths.port=Poort
auths.base_dn=Base DN
auths.attribute_username=Gebruikersnaam attribuut
auths.bind_dn=Bind DN
auths.bind_password=Bind Password
auths.user_base=User Search Base
auths.attribute_name=Voornaam attribuut
auths.attribute_surname=Achternaam attribuut
auths.attribute_mail=E-mail attribuut
auths.filter=Zoek filter
auths.filter=User Filter
auths.admin_filter=Admin Filter
auths.ms_ad_sa=MS Ad SA
auths.smtp_auth=SMTP authenticatietype
auths.smtphost=SMTP host
@ -806,7 +813,7 @@ config.enable_cache_avatar=Avatar Cache inschakelen
config.active_code_lives=Actieve Code leven
config.reset_password_code_lives=Reset wachtwoord Code leven
config.webhook_config=Webhook configuratie
config.queue_length=Queue Length
config.queue_length=Lengte van wachtrij
config.deliver_timeout=Bezorging verlooptijd
config.skip_tls_verify=TLS certificaat controle overslaan
config.mailer_config=Mailerconfiguatie
@ -885,7 +892,8 @@ raw_seconds=seconden
raw_minutes=minuten
[dropzone]
default_message=Drop files here or click to upload.
invalid_input_type=You can't upload files of this type.
file_too_big=File size({{filesize}} MB) exceeds maximum size({{maxFilesize}} MB).
remove_file=Remove file
default_message=Drop bestanden hier of klik om te uploaden.
invalid_input_type=U kunt geen bestanden van dit type uploaden.
file_too_big=Bestandsgrootte ({{filesize}} MB) overschrijdt de maximale grootte ({{maxFilesize}} MB).
remove_file=Verwijder bestand

View file

@ -76,6 +76,8 @@ run_user=运行系统用户
run_user_helper=该用户必须具有对仓库根目录和运行 Gogs 的操作权限。
domain=域名
domain_helper=该设置影响 SSH 克隆地址。
ssh_port=SSH 端口号
ssh_port_helper=SSH 服务器的监听端口号,留空表示禁用 SSH 功能。
http_port=HTTP 端口号
http_port_helper=应用监听的端口号
app_url=应用 URL
@ -278,6 +280,7 @@ add_on=增加于
last_used=上次使用在
no_activity=没有最近活动
key_state_desc=该密钥在 7 天内被使用过
token_state_desc=该令牌在 7 天内被使用过
manage_social=管理关联社交帐户
social_desc=以下是与您帐户所关联的社交帐号,如果您发现有陌生的关联,请立即解除绑定!
@ -292,6 +295,8 @@ token_name=令牌名称
generate_token=生成令牌
generate_token_succees=新的操作令牌生成成功!您必须立即复制到一个安全的地方,因为该令牌只会显示一次!
delete_token=删除令牌
access_token_deletion=删除个人操作令牌
access_token_deletion_desc=删除该个人操作令牌将删除所有相关的应用程序的访问权限。是否继续?
delete_token_success=个人操作令牌删除成功!请更新与该令牌有关的所有应用。
delete_account=删除当前帐户
@ -751,12 +756,14 @@ auths.auth_name=授权名称
auths.domain=域名
auths.host=主机地址
auths.port=主机端口
auths.base_dn=Base DN
auths.attribute_username=用户名属性
auths.bind_dn=绑定 DN
auths.bind_password=绑定密码
auths.user_base=用户搜索基准
auths.attribute_name=名字属性
auths.attribute_surname=姓氏属性
auths.attribute_mail=邮箱属性
auths.filter=Search Filter
auths.filter=用户过滤规则
auths.admin_filter=管理员过滤规则
auths.ms_ad_sa=Ms Ad SA
auths.smtp_auth=SMTP 授权类型
auths.smtphost=SMTP 主机地址
@ -889,3 +896,4 @@ default_message=拖曳文件到此处或单击上传
invalid_input_type=您不能上传该类型的文件
file_too_big=文件体积({{filesize}} MB超过了最大允许体积{{maxFilesize}} MB
remove_file=移除文件

File diff suppressed because one or more lines are too long

View file

@ -217,9 +217,11 @@ func Contexter() macaron.Handler {
ctx.IsSigned = true
ctx.Data["IsSigned"] = ctx.IsSigned
ctx.Data["SignedUser"] = ctx.User
ctx.Data["SignedUserID"] = ctx.User.Id
ctx.Data["SignedUserName"] = ctx.User.Name
ctx.Data["IsAdmin"] = ctx.User.IsAdmin
} else {
ctx.Data["SignedUserID"] = 0
ctx.Data["SignedUserName"] = ""
}

File diff suppressed because one or more lines are too long

View file

@ -228,6 +228,39 @@ function initRepository() {
// Issues
if ($('.repository.view.issue').length > 0) {
// Edit issue title
var $issue_title = $('#issue-title');
var $edit_input = $('#edit-title-input input');
var editTitleToggle = function () {
$issue_title.toggle();
$('.not-in-edit').toggle();
$('#edit-title-input').toggle();
$('.in-edit').toggle();
$edit_input.focus();
return false;
}
$('#edit-title').click(editTitleToggle);
$('#cancel-edit-title').click(editTitleToggle);
$('#save-edit-title').click(editTitleToggle).
click(function () {
if ($edit_input.val().length == 0 ||
$edit_input.val() == $issue_title.text()) {
$edit_input.val($issue_title.text());
return false;
}
$.post($(this).data('update-url'), {
"_csrf": csrf,
"title": $edit_input.val()
},
function (data) {
$edit_input.val(data.title);
$issue_title.text(data.title);
});
return false;
});
// Change status
var $status_btn = $('#status-button');
$('#content').keyup(function () {
if ($(this).val().length == 0) {

View file

@ -151,6 +151,16 @@
font-weight: 300;
font-size: 3rem;
margin-bottom: 5px;
.ui.input {
font-size: 0.5em;
vertical-align: top;
width: 50%;
min-width: 600px;
input {
font-size: 1.5em;
padding: 6px 10px;
}
}
}
.index {
font-weight: 300;
@ -160,6 +170,9 @@
.label {
margin-right: 10px;
}
.edit-zone {
margin-top: 10px;
}
}
.comment-list {
&:before {
@ -187,6 +200,15 @@
border: 1px solid rgba(0,0,0,0.1);
border-radius: 3px;
}
.actions {
.item {
float: left;
}
a.item {
margin-top: 6px;
margin-left: 10px;
}
}
.content {
margin-left: 4em;
.header {

View file

@ -524,49 +524,6 @@ func ViewIssue(ctx *middleware.Context) {
ctx.HTML(200, ISSUE_VIEW)
}
func UpdateIssue(ctx *middleware.Context, form auth.CreateIssueForm) {
idx := com.StrTo(ctx.Params(":index")).MustInt64()
if idx <= 0 {
ctx.Error(404)
return
}
issue, err := models.GetIssueByIndex(ctx.Repo.Repository.ID, idx)
if err != nil {
if models.IsErrIssueNotExist(err) {
ctx.Handle(404, "issue.UpdateIssue", err)
} else {
ctx.Handle(500, "issue.UpdateIssue(GetIssueByIndex)", err)
}
return
}
if ctx.User.Id != issue.PosterID && !ctx.Repo.IsOwner() {
ctx.Error(403)
return
}
issue.Name = form.Title
//issue.MilestoneId = form.MilestoneId
//issue.AssigneeId = form.AssigneeId
//issue.LabelIds = form.Labels
issue.Content = form.Content
// try get content from text, ignore conflict with preview ajax
if form.Content == "" {
issue.Content = ctx.Query("text")
}
if err = models.UpdateIssue(issue); err != nil {
ctx.Handle(500, "issue.UpdateIssue(UpdateIssue)", err)
return
}
ctx.JSON(200, map[string]interface{}{
"ok": true,
"title": issue.Name,
"content": string(base.RenderMarkdown([]byte(issue.Content), ctx.Repo.RepoLink)),
})
}
func getActionIssue(ctx *middleware.Context) *models.Issue {
issue, err := models.GetIssueByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index"))
if err != nil {
@ -580,6 +537,36 @@ func getActionIssue(ctx *middleware.Context) *models.Issue {
return issue
}
func UpdateIssueTitle(ctx *middleware.Context) {
issue := getActionIssue(ctx)
if ctx.Written() {
return
}
if !ctx.IsSigned || ctx.User.Id != issue.PosterID || !ctx.Repo.IsAdmin() {
ctx.Error(403)
return
}
title := ctx.Query("title")
if len(title) == 0 {
ctx.JSON(200, map[string]interface{}{
"title": issue.Name,
})
return
}
issue.Name = title
if err := models.UpdateIssue(issue); err != nil {
ctx.Handle(500, "UpdateIssue", err)
return
}
ctx.JSON(200, map[string]interface{}{
"title": issue.Name,
})
}
func UpdateIssueLabel(ctx *middleware.Context) {
issue := getActionIssue(ctx)
if ctx.Written() {

View file

@ -60,7 +60,7 @@
<input class="ipt ipt-large ipt-radius {{if .Err_Filter}}ipt-error{{end}}" id="filter" name="filter" value="{{.Source.LDAP.Filter}}" />
</div>
<div class="field">
<label class="req" for="filter">{{.i18n.Tr "admin.auths.admin_filter"}}</label>
<label for="filter">{{.i18n.Tr "admin.auths.admin_filter"}}</label>
<input class="ipt ipt-large ipt-radius {{if .Err_AdminFilter}}ipt-error{{end}}" id="admin_filter" name="admin_filter" value="{{.Source.LDAP.AdminFilter}}" />
</div>
<div class="field">

View file

@ -56,7 +56,7 @@
<input class="ipt ipt-large ipt-radius {{if .Err_Filter}}ipt-error{{end}}" id="filter" name="filter" value="{{.filter}}" />
</div>
<div class="field">
<label class="req" for="filter">{{.i18n.Tr "admin.auths.admin_filter"}}</label>
<label for="filter">{{.i18n.Tr "admin.auths.admin_filter"}}</label>
<input class="ipt ipt-large ipt-radius {{if .Err_AdminFilter}}ipt-error{{end}}" id="admin_filter" name="admin_filter" value="{{.admin_filter}}" />
</div>
<div class="field">

View file

@ -5,7 +5,23 @@
</div>
{{end}}
<div class="sixteen wide column title">
<h1><span class="index">#{{.Issue.Index}}</span> {{.Issue.Name}}</h1>
<div class="ui grid">
<h1 class="twelve wide column">
<span class="index">#{{.Issue.Index}}</span> <span id="issue-title">{{.Issue.Name}}</span>
<div id="edit-title-input" class="ui input" style="display: none">
<input value="{{.Issue.Name}}">
</div>
</h1>
{{if .IsIssueOwner}}
<div class="four wide column">
<div class="edit-zone text right">
<div id="edit-title" class="ui basic green not-in-edit button">{{.i18n.Tr "repo.issues.edit"}}</div>
<div id="cancel-edit-title" class="ui basic blue in-edit button" style="display: none">{{.i18n.Tr "repo.issues.cancel"}}</div>
<div id="save-edit-title" class="ui green in-edit button" style="display: none" data-update-url="{{.Link}}/title">{{.i18n.Tr "repo.issues.save"}}</div>
</div>
</div>
{{end}}
</div>
{{if .Issue.IsClosed}}
<div class="ui red large label"><i class="octicon octicon-issue-closed"></i> {{.i18n.Tr "repo.issues.closed_title"}}</div>
{{else}}
@ -33,6 +49,9 @@
<div class="ui top attached header">
<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>
{{end}}
</div>
</div>
<div class="ui attached segment markdown">
@ -68,7 +87,7 @@
<span class="text grey"><a {{if gt .Poster.Id 0}}href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.Name}}</a> {{$.i18n.Tr "repo.issues.commented_at" .HashTag $createdStr | Safe}}</span>
<div class="ui right actions">
{{if gt .ShowTag 0}}
<div class="tag">
<div class="item tag">
{{if eq .ShowTag 1}}
{{$.i18n.Tr "repo.issues.poster"}}
{{else if eq .ShowTag 2}}
@ -78,6 +97,9 @@
{{end}}
</div>
{{end}}
{{if or $.IsRepositoryAdmin (eq .Poster.Id $.SignedUserID)}}
<a class="item" href="#"><i class="octicon octicon-pencil"></i></a>
{{end}}
</div>
</div>
<div class="ui attached segment markdown">