mirror of
https://github.com/discourse/discourse.git
synced 2025-06-12 22:23:44 +08:00
FIX: Use 1 column instead of 4 for permalink destination (#9260)
This commit is contained in:
@ -1,4 +1,7 @@
|
|||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
|
import DiscourseURL from "discourse/lib/url";
|
||||||
|
import Category from "discourse/models/category";
|
||||||
import EmberObject from "@ember/object";
|
import EmberObject from "@ember/object";
|
||||||
|
|
||||||
const Permalink = EmberObject.extend({
|
const Permalink = EmberObject.extend({
|
||||||
@ -13,6 +16,16 @@ const Permalink = EmberObject.extend({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@discourseComputed("category_id")
|
||||||
|
category: function(category_id) {
|
||||||
|
return Category.findById(category_id);
|
||||||
|
},
|
||||||
|
|
||||||
|
@discourseComputed("external_url")
|
||||||
|
linkIsExternal: function(external_url) {
|
||||||
|
return !DiscourseURL.isInternal(external_url);
|
||||||
|
},
|
||||||
|
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
return ajax("/admin/permalinks/" + this.id + ".json", {
|
return ajax("/admin/permalinks/" + this.id + ".json", {
|
||||||
type: "DELETE"
|
type: "DELETE"
|
||||||
|
@ -15,33 +15,27 @@
|
|||||||
<table class='admin-logs-table permalinks grid'>
|
<table class='admin-logs-table permalinks grid'>
|
||||||
<thead class="heading-container">
|
<thead class="heading-container">
|
||||||
<th class="col heading first url">{{i18n 'admin.permalink.url'}}</th>
|
<th class="col heading first url">{{i18n 'admin.permalink.url'}}</th>
|
||||||
<th class="col heading topic">{{i18n 'admin.permalink.topic_title'}}</th>
|
<th class="col heading destination">{{i18n 'admin.permalink.destination'}}</th>
|
||||||
<th class="col heading post">{{i18n 'admin.permalink.post_title'}}</th>
|
|
||||||
<th class="col heading category">{{i18n 'admin.permalink.category_title'}}</th>
|
|
||||||
<th class="col heading external_url">{{i18n 'admin.permalink.external_url'}}</th>
|
|
||||||
<th class="col heading actions"></th>
|
<th class="col heading actions"></th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{{#each model as |pl|}}
|
{{#each model as |pl|}}
|
||||||
<tr class="admin-list-item">
|
<tr class="admin-list-item">
|
||||||
<td class="col first url">{{pl.url}}</td>
|
<td class="col first url">{{pl.url}}</td>
|
||||||
<td class="col topic">
|
<td class="col destination">
|
||||||
{{#if pl.topic_id}}
|
{{#if pl.topic_id}}
|
||||||
<a href={{pl.topic_url}}>{{pl.topic_title}}</a>
|
<a href={{pl.topic_url}}>{{pl.topic_title}}</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</td>
|
|
||||||
<td class="col post">
|
|
||||||
{{#if pl.post_id}}
|
{{#if pl.post_id}}
|
||||||
<a href={{pl.post_url}}>#{{pl.post_number}} {{pl.post_topic_title}}</a>
|
<a href={{pl.post_url}}>{{pl.post_topic_title}} #{{pl.post_number}}</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</td>
|
|
||||||
<td class="col category">
|
|
||||||
{{#if pl.category_id}}
|
{{#if pl.category_id}}
|
||||||
<a href={{pl.category_url}}>{{pl.category_name}}</a>
|
{{category-link pl.category}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</td>
|
|
||||||
<td class="col external_url">
|
|
||||||
{{#if pl.external_url}}
|
{{#if pl.external_url}}
|
||||||
|
{{#if pl.linkIsExternal}}
|
||||||
|
{{d-icon "external-link-alt"}}
|
||||||
|
{{/if}}
|
||||||
<a href={{pl.external_url}}>{{pl.external_url}}</a>
|
<a href={{pl.external_url}}>{{pl.external_url}}</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</td>
|
</td>
|
||||||
|
@ -4593,6 +4593,7 @@ en:
|
|||||||
category_id: "Category ID"
|
category_id: "Category ID"
|
||||||
category_title: "Category"
|
category_title: "Category"
|
||||||
external_url: "External URL"
|
external_url: "External URL"
|
||||||
|
destination: "Destination"
|
||||||
delete_confirm: Are you sure you want to delete this permalink?
|
delete_confirm: Are you sure you want to delete this permalink?
|
||||||
form:
|
form:
|
||||||
label: "New:"
|
label: "New:"
|
||||||
|
Reference in New Issue
Block a user