Skip to content

Commit

Permalink
Fix MergeConflict relicts and fronted Lint (go-gitea#6)
Browse files Browse the repository at this point in the history
* some fixes
clectecd from conflict resolve and so on

* Fix Frontend LINT errors
  • Loading branch information
6543 authored Apr 13, 2020
1 parent a87c8ca commit 4ce64a1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 35 deletions.
42 changes: 19 additions & 23 deletions templates/repo/issue/view_content/comments.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
13 = STOP_TRACKING, 14 = ADD_TIME_MANUAL, 16 = ADDED_DEADLINE, 17 = MODIFIED_DEADLINE,
18 = REMOVED_DEADLINE, 19 = ADD_DEPENDENCY, 20 = REMOVE_DEPENDENCY, 21 = CODE,
22 = REVIEW, 23 = ISSUE_LOCKED, 24 = ISSUE_UNLOCKED, 25 = TARGET_BRANCH_CHANGED,
26 = DELETE_TIME_MANUAL, 27 = REVIEW_REQUEST
28 = DELETE_TIME_MANUAL, 29 = PROJECT_CHANGED, 30 = Project_Board_CHANGED -->
26 = DELETE_TIME_MANUAL, 27 = REVIEW_REQUEST, 28 = PROJECT_CHANGED,
29 = Project_Board_CHANGED -->
{{if eq .Type 0}}
<div class="timeline-item comment" id="{{.HashTag}}">
{{if .OriginalAuthor }}
Expand Down Expand Up @@ -510,27 +510,23 @@
{{end}}
</span>
</div>


{{ else if eq .Type 28 }}
{{else if eq .Type 28}}
<div class="event">
<span class="octicon octicon-primitive-dot"></span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}">
</a>
<span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{if gt .OldProjectID 0}}
{{if gt .ProjectID 0}}
{{$.i18n.Tr "repo.issues.change_project_at" (.OldProject.Title|Escape) (.Project.Title|Escape) $createdStr | Safe}}

{{else}}
{{$.i18n.Tr "repo.issues.remove_project_at" (.OldProject.Title|Escape) $createdStr | Safe}}
{{end}}
{{else if gt .ProjectID 0}}
{{$.i18n.Tr "repo.issues.add_project_at" (.Project.Title|Escape) $createdStr | Safe}}
{{end}}
</span>
</div>

<span class="octicon octicon-primitive-dot"></span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}">
</a>
<span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
{{if gt .OldProjectID 0}}
{{if gt .ProjectID 0}}
{{$.i18n.Tr "repo.issues.change_project_at" (.OldProject.Title|Escape) (.Project.Title|Escape) $createdStr | Safe}}
{{else}}
{{$.i18n.Tr "repo.issues.remove_project_at" (.OldProject.Title|Escape) $createdStr | Safe}}
{{end}}
{{else if gt .ProjectID 0}}
{{$.i18n.Tr "repo.issues.add_project_at" (.Project.Title|Escape) $createdStr | Safe}}
{{end}}
</span>
</div>
{{end}}
{{end}}
6 changes: 2 additions & 4 deletions templates/repo/issue/view_content/sidebar.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,10 @@

<div class="ui divider"></div>

<div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-project dropdown">
<div class="ui {{if or (not .IsIssueWriter) .Repository.IsArchived}}disabled{{end}} floating jump select-project dropdown">
<span class="text">
<strong>{{.i18n.Tr "repo.issues.new.projects"}}</strong>
{{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}}
{{svg "octicon-gear" 16}}
{{end}}
<span class="octicon octicon-gear"></span>
</span>
<div class="menu" data-action="update" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/projects">
<div class="no-select item">{{.i18n.Tr "repo.issues.new.clear_projects"}}</div>
Expand Down
17 changes: 9 additions & 8 deletions web_src/js/features/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default async function initProject(csrf) {
return;
}

const { Sortable } = await import(
const {Sortable} = await import(
/* webpackChunkName: "sortable" */ 'sortablejs'
);

Expand All @@ -17,7 +17,7 @@ export default async function initProject(csrf) {
{
group: 'shared',
animation: 150,
onAdd: e => {
onAdd: (e) => {
$.ajax(`${e.to.dataset.url}/${e.item.dataset.issue}`, {
headers: {
'X-Csrf-Token': csrf,
Expand All @@ -34,7 +34,7 @@ export default async function initProject(csrf) {
);
}

$('.edit-project-board').each(function() {
$('.edit-project-board').each(function () {
// const modal = $(this);

const projectTitle = $(this).find(
Expand All @@ -43,26 +43,27 @@ export default async function initProject(csrf) {

$(this)
.find('.content > .form > .actions > .red')
.click(function(e) {
.click(function (e) {
e.preventDefault();
$.ajax({
url: $(this).data('url'),
data: JSON.stringify({ title: projectTitle.val() }),
data: JSON.stringify({title: projectTitle.val()}),
headers: {
'X-Csrf-Token': csrf,
'X-Remote': true,
},
contentType: 'application/json',
method: 'PUT',
}).done(res => {
// eslint-disable-next-line no-unused-vars
}).done((res) => {
// modal.modal('hide');
setTimeout(window.location.reload(true), 2000);
});
});
});

$('.delete-project-board').each(function() {
$(this).click(function(e) {
$('.delete-project-board').each(function () {
$(this).click(function (e) {
e.preventDefault();

$.ajax({
Expand Down

0 comments on commit 4ce64a1

Please sign in to comment.