UX: more permalinks page improvements

This commit is contained in:
Arpit Jalan
2015-07-20 17:40:22 +05:30
parent 80832d0b71
commit c54de7159c
5 changed files with 27 additions and 18 deletions

View File

@ -10,9 +10,9 @@
<div class='table admin-logs-table permalinks'> <div class='table admin-logs-table permalinks'>
<div class="heading-container"> <div class="heading-container">
<div class="col heading first url">{{i18n 'admin.permalink.url'}}</div> <div class="col heading first url">{{i18n 'admin.permalink.url'}}</div>
<div class="col heading topic_id">{{i18n 'admin.permalink.topic_id'}}</div> <div class="col heading topic">{{i18n 'admin.permalink.topic_title'}}</div>
<div class="col heading post_id">{{i18n 'admin.permalink.post_id'}}</div> <div class="col heading post">{{i18n 'admin.permalink.post_title'}}</div>
<div class="col heading category_id">{{i18n 'admin.permalink.category_id'}}</div> <div class="col heading category">{{i18n 'admin.permalink.category_title'}}</div>
<div class="col heading external_url">{{i18n 'admin.permalink.external_url'}}</div> <div class="col heading external_url">{{i18n 'admin.permalink.external_url'}}</div>
<div class="col heading actions"></div> <div class="col heading actions"></div>
<div class="clearfix"></div> <div class="clearfix"></div>

View File

@ -1,19 +1,17 @@
<div class="col first url">{{url}}</div> <div class="col first url">{{url}}</div>
<div class="col topic_id"> <div class="col topic">
{{#if topic_id}} {{#if topic_id}}
{{topic_id}} <a href='{{unbound topic_url}}'>{{topic_title}}</a>
(<a href='{{unbound topic_url}}'>{{topic_title}}</a>)
{{/if}} {{/if}}
</div> </div>
<div class="col post_id"> <div class="col post">
{{#if post_id}} {{#if post_id}}
<a href='{{unbound post_url}}'>{{post_id}}</a> <a href='{{unbound post_url}}'>#{{post_number}} {{post_topic_title}}</a>
{{/if}} {{/if}}
</div> </div>
<div class="col category_id"> <div class="col category">
{{#if category_id}} {{#if category_id}}
{{category_id}} <a href='{{unbound category_url}}'>{{category_name}}</a>
(<a href='{{unbound category_url}}'>{{category_name}}</a>)
{{/if}} {{/if}}
</div> </div>
<div class="col external_url"> <div class="col external_url">

View File

@ -1473,20 +1473,20 @@ table#user-badges {
// Permalinks // Permalinks
.permalinks { .permalinks {
.url, .topic_id, .category_id, .external_url { .url, .topic, .category, .external_url, .post {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.url { .url {
width: 200px; width: 200px;
} }
.topic_id, .external_url { .topic, .post, .external_url {
width: 220px; width: 180px;
} }
.category_id { .category {
width: 160px; width: 140px;
} }
.action, .post_id { .action {
text-align: center; text-align: center;
width: 8%; width: 8%;
} }

View File

@ -1,5 +1,5 @@
class PermalinkSerializer < ApplicationSerializer class PermalinkSerializer < ApplicationSerializer
attributes :id, :url, :topic_id, :topic_title, :topic_url, :post_id, :post_url, :category_id, :category_name, :category_url, :external_url attributes :id, :url, :topic_id, :topic_title, :topic_url, :post_id, :post_url, :post_number, :post_topic_title, :category_id, :category_name, :category_url, :external_url
def topic_title def topic_title
object.try(:topic).try(:title) object.try(:topic).try(:title)
@ -13,6 +13,14 @@ class PermalinkSerializer < ApplicationSerializer
object.try(:post).try(:url) object.try(:post).try(:url)
end end
def post_number
object.try(:post).try(:post_number)
end
def post_topic_title
object.try(:post).try(:topic).try(:title)
end
def category_name def category_name
object.try(:category).try(:name) object.try(:category).try(:name)
end end

View File

@ -2447,8 +2447,11 @@ en:
title: "Permalinks" title: "Permalinks"
url: "URL" url: "URL"
topic_id: "Topic ID" topic_id: "Topic ID"
topic_title: "Topic"
post_id: "Post ID" post_id: "Post ID"
post_title: "Post"
category_id: "Category ID" category_id: "Category ID"
category_title: "Category"
external_url: "External URL" external_url: "External URL"
delete_confirm: Are you sure you want to delete this permalink? delete_confirm: Are you sure you want to delete this permalink?
form: form: