Remove remaining code for two-column categories page

This commit is contained in:
Neil Lalonde 2014-01-07 18:13:35 -05:00
parent b268ea8363
commit e7975f25b8
16 changed files with 121 additions and 156 deletions

View File

@ -15,21 +15,6 @@ Discourse.ListCategoriesController = Discourse.ObjectController.extend({
} }
}, },
categoriesEven: function() {
if (this.blank('categories')) return Em.A();
return this.get('categories').filter(function(item, index) {
return (index % 2) === 0;
});
}.property('categories.@each'),
categoriesOdd: function() {
if (this.blank('categories')) return Em.A();
return this.get('categories').filter(function(item, index) {
return (index % 2) === 1;
});
}.property('categories.@each'),
canEdit: function() { canEdit: function() {
return Discourse.User.currentProp('staff'); return Discourse.User.currentProp('staff');
}.property(), }.property(),

View File

@ -8,12 +8,7 @@
**/ **/
Discourse.ListCategoriesRoute = Discourse.Route.extend({ Discourse.ListCategoriesRoute = Discourse.Route.extend({
template: function() { template: 'listCategories',
// Remove the option to have 2-column layout on categories page.
// TODO: remove this old code when we're sure about it.
// return Discourse.SiteSettings.enable_wide_category_list ? 'listWideCategories' : 'listCategories';
return 'listWideCategories';
}.property(),
redirect: function() { Discourse.redirectIfLoginRequired(this); }, redirect: function() { Discourse.redirectIfLoginRequired(this); },

View File

@ -1,8 +1,111 @@
<section class="category-column first"> <div class='contents'>
{{each categoriesEven itemViewClass="Discourse.FeaturedTopicsView"}}
</section> <table id='topic-list' class='categories'>
<section class="category-column"> <thead>
{{each categoriesOdd itemViewClass="Discourse.FeaturedTopicsView"}} <tr>
</section> <th class='category'>{{i18n categories.category}}</th>
<th class='latest'>{{i18n categories.latest}}</th>
<th class='stats topics'>{{i18n categories.topics}}</th>
<th class='stats posts'>{{i18n categories.posts}}
{{#if canEdit}}
<button title='{{i18n categories.toggle_ordering}}' class='btn toggle-admin no-text' {{action toggleOrdering}}><i class='fa fa-wrench'></i></button>
{{/if}}
</th>
</tr>
</thead>
<tbody>
{{#each model.categories}}
<tr data-category_id='{{unbound id}}' {{bindAttr class="description_excerpt:has-description:no-description"}}>
<td class='category'>
<div>
<div class="pull-left">
{{#if controller.ordering}}
<i class="fa fa-bars"></i>
{{/if}}
{{categoryLink this allowUncategorized=true}}
{{#if unreadTopics}}
<a href={{unbound unreadUrl}} class='badge new-posts badge-notification' title='{{i18n topic.unread_topics count="unreadTopics"}}'>{{unbound unreadTopics}}</a>
{{/if}}
{{#if newTopics}}
<a href={{unbound newUrl}} class='badge new-posts badge-notification' title='{{i18n topic.new_topics count="newTopics"}}'>{{unbound newTopics}} <i class='fa fa-asterisk'></i></a>
{{/if}}
</div>
<div class='featured-users'>
{{#each featured_users}}
<a href="/users/{{unbound username_lower}}">{{avatar this imageSize="small"}}</a>
{{/each}}
</div>
<div class="clearfix"></div>
</div>
{{#if description_excerpt}}
<div class="category-description">
{{{description_excerpt}}}
</div>
{{/if}}
{{#if subcategories}}
<div class='subcategories'>
{{i18n categories.subcategories}}
{{#each subcategory in subcategories}}
{{categoryLink subcategory}}
{{/each}}
</div>
{{/if}}
</td>
<td {{bindAttr class="archived :latest"}}>
{{#each featuredTopics}}
<div class="featured-topic">
{{topicStatus topic=this}}
<a class='title' href="{{unbound lastUnreadUrl}}">{{{unbound fancy_title}}}</a>
{{#if unread}}
<a href="{{unbound lastUnreadUrl}}" class='badge unread badge-notification' title='{{i18n topic.unread_posts count="unread"}}'>{{unread}}</a>
{{/if}}
{{#if new_posts}}
<a href="{{unbound lastUnreadUrl}}" class='badge new-posts badge-notification' title='{{i18n topic.new_posts count="new_posts"}}'>{{new_posts}}</a>
{{/if}}
{{#if unseen}}
<a href="{{unbound lastUnreadUrl}}" class='badge new-posts badge-notification' title='{{i18n topic.new}}'><i class='fa fa-asterisk'></i></a>
{{/if}}
{{#if controller.latestTopicOnly}}
<div class='last-user-info'>
{{i18n categories.latest_by}} <a href="{{{unbound lastPosterUrl}}}">{{unbound last_poster.username}}</a>
<a href="{{unbound lastPostUrl}}">{{unboundAge last_posted_at}}</a>
</div>
{{else}}
&nbsp;
<a href="{{unbound lastPostUrl}}" class="last-posted-at">{{unboundAge last_posted_at}}</a>
{{/if}}
</div>
{{/each}}
</td>
<td class='stats' {{bindAttr title="topicStatsTitle"}}>
<table class="categoryStats">
{{#each topicCountStats}}
<tr>
<td class="value">{{value}}</td>
<td class="unit">{{unit}}</td>
</tr>
{{/each}}
</table>
</td>
<td class='stats' {{bindAttr title="postStatsTitle"}}>
<table class="categoryStats">
{{#each postCountStats}}
<tr>
<td class="value">{{value}}</td>
<td class="unit">{{unit}}</td>
</tr>
{{/each}}
</table>
</td>
</tr>
{{/each}}
</tbody>
</table>
</div>
<footer id='topic-list-bottom'>
</footer>
<div class='clearfix'></div>

View File

@ -1,111 +0,0 @@
<div class='contents'>
<table id='topic-list' class='categories'>
<thead>
<tr>
<th class='category'>{{i18n categories.category}}</th>
<th class='latest'>{{i18n categories.latest}}</th>
<th class='stats topics'>{{i18n categories.topics}}</th>
<th class='stats posts'>{{i18n categories.posts}}
{{#if canEdit}}
<button title='{{i18n categories.toggle_ordering}}' class='btn toggle-admin no-text' {{action toggleOrdering}}><i class='fa fa-wrench'></i></button>
{{/if}}
</th>
</tr>
</thead>
<tbody>
{{#each model.categories}}
<tr data-category_id='{{unbound id}}' {{bindAttr class="description_excerpt:has-description:no-description"}}>
<td class='category'>
<div>
<div class="pull-left">
{{#if controller.ordering}}
<i class="fa fa-bars"></i>
{{/if}}
{{categoryLink this allowUncategorized=true}}
{{#if unreadTopics}}
<a href={{unbound unreadUrl}} class='badge new-posts badge-notification' title='{{i18n topic.unread_topics count="unreadTopics"}}'>{{unbound unreadTopics}}</a>
{{/if}}
{{#if newTopics}}
<a href={{unbound newUrl}} class='badge new-posts badge-notification' title='{{i18n topic.new_topics count="newTopics"}}'>{{unbound newTopics}} <i class='fa fa-asterisk'></i></a>
{{/if}}
</div>
<div class='featured-users'>
{{#each featured_users}}
<a href="/users/{{unbound username_lower}}">{{avatar this imageSize="small"}}</a>
{{/each}}
</div>
<div class="clearfix"></div>
</div>
{{#if description_excerpt}}
<div class="category-description">
{{{description_excerpt}}}
</div>
{{/if}}
{{#if subcategories}}
<div class='subcategories'>
{{i18n categories.subcategories}}
{{#each subcategory in subcategories}}
{{categoryLink subcategory}}
{{/each}}
</div>
{{/if}}
</td>
<td {{bindAttr class="archived :latest"}}>
{{#each featuredTopics}}
<div class="featured-topic">
{{topicStatus topic=this}}
<a class='title' href="{{unbound lastUnreadUrl}}">{{{unbound fancy_title}}}</a>
{{#if unread}}
<a href="{{unbound lastUnreadUrl}}" class='badge unread badge-notification' title='{{i18n topic.unread_posts count="unread"}}'>{{unread}}</a>
{{/if}}
{{#if new_posts}}
<a href="{{unbound lastUnreadUrl}}" class='badge new-posts badge-notification' title='{{i18n topic.new_posts count="new_posts"}}'>{{new_posts}}</a>
{{/if}}
{{#if unseen}}
<a href="{{unbound lastUnreadUrl}}" class='badge new-posts badge-notification' title='{{i18n topic.new}}'><i class='fa fa-asterisk'></i></a>
{{/if}}
{{#if controller.latestTopicOnly}}
<div class='last-user-info'>
{{i18n categories.latest_by}} <a href="{{{unbound lastPosterUrl}}}">{{unbound last_poster.username}}</a>
<a href="{{unbound lastPostUrl}}">{{unboundAge last_posted_at}}</a>
</div>
{{else}}
&nbsp;
<a href="{{unbound lastPostUrl}}" class="last-posted-at">{{unboundAge last_posted_at}}</a>
{{/if}}
</div>
{{/each}}
</td>
<td class='stats' {{bindAttr title="topicStatsTitle"}}>
<table class="categoryStats">
{{#each topicCountStats}}
<tr>
<td class="value">{{value}}</td>
<td class="unit">{{unit}}</td>
</tr>
{{/each}}
</table>
</td>
<td class='stats' {{bindAttr title="postStatsTitle"}}>
<table class="categoryStats">
{{#each postCountStats}}
<tr>
<td class="value">{{value}}</td>
<td class="unit">{{unit}}</td>
</tr>
{{/each}}
</table>
</td>
</tr>
{{/each}}
</tbody>
</table>
</div>
<footer id='topic-list-bottom'>
</footer>

View File

@ -1,4 +1,4 @@
Discourse.ListWideCategoriesView = Discourse.View.extend({ Discourse.ListCategoriesView = Discourse.View.extend({
orderingChanged: function(){ orderingChanged: function(){
if (this.get("controller.ordering")) { if (this.get("controller.ordering")) {

View File

@ -9,9 +9,6 @@ class CategoriesController < ApplicationController
def index def index
@description = SiteSetting.site_description @description = SiteSetting.site_description
# TODO: remove this when we're sure about removing 2-column layout on categories page
# wide_mode = SiteSetting.enable_wide_category_list
options = {} options = {}
options[:latest_posts] = params[:latest_posts] || SiteSetting.category_featured_topics options[:latest_posts] = params[:latest_posts] || SiteSetting.category_featured_topics

View File

@ -723,7 +723,6 @@ da:
min_body_similar_length: "Den mindste længde af en brødtekst før der ledes efter lignende emner." min_body_similar_length: "Den mindste længde af en brødtekst før der ledes efter lignende emner."
category_colors: "En pipe-separeret (|) liste af tilladte hexadecimale farveværdier for kategorier." category_colors: "En pipe-separeret (|) liste af tilladte hexadecimale farveværdier for kategorier."
enable_wide_category_list: "Aktivér traditionel, fuldbredde kategoriliste uden tiling. BEMÆRK: Denne indstilling har ingen virkning og bliver fjernet. Den brede liste er den eneste mulighed nu."
max_image_size_kb: "Den maksimale billedstørrelse som vi lader brugerne uploade, i kB - husk at tilpasse den tilsvarende værdi i nginx (client_max_body_size) / apache eller proxy." max_image_size_kb: "Den maksimale billedstørrelse som vi lader brugerne uploade, i kB - husk at tilpasse den tilsvarende værdi i nginx (client_max_body_size) / apache eller proxy."
max_attachment_size_kb: "Den maksimale filstørrelse som vi lader brugerne uploade, i kB - husk at tilpasse den tilsvarende værdi i nginx (client_max_body_size) / apache eller proxy." max_attachment_size_kb: "Den maksimale filstørrelse som vi lader brugerne uploade, i kB - husk at tilpasse den tilsvarende værdi i nginx (client_max_body_size) / apache eller proxy."

View File

@ -720,7 +720,6 @@ en:
min_body_similar_length: "The minimum length of a post's body before it will be checked for similar topics" min_body_similar_length: "The minimum length of a post's body before it will be checked for similar topics"
category_colors: "A pipe (|) separated list of hexadecimal color values allowed for categories" category_colors: "A pipe (|) separated list of hexadecimal color values allowed for categories"
enable_wide_category_list: "Enable traditional full width, non-tiling, category list. NOTE: this setting currently does nothing and will be removed. Wide list is the only option now."
max_image_size_kb: "The maximum size of images we allow users to upload in kB - configure the limit in nginx (client_max_body_size) / apache or proxy as well." max_image_size_kb: "The maximum size of images we allow users to upload in kB - configure the limit in nginx (client_max_body_size) / apache or proxy as well."
max_attachment_size_kb: "The maximum size of files we allow users to upload in kB - configure the limit in nginx (client_max_body_size) / apache or proxy as well." max_attachment_size_kb: "The maximum size of files we allow users to upload in kB - configure the limit in nginx (client_max_body_size) / apache or proxy as well."

View File

@ -615,7 +615,6 @@ fr:
min_title_similar_length: "La taille minimale d'un titre avant que l'on vérifie l'existence de discussions identiques" min_title_similar_length: "La taille minimale d'un titre avant que l'on vérifie l'existence de discussions identiques"
min_body_similar_length: "La taille minimale d'un message avant que l'on vérifie l'existence de discussions identiques" min_body_similar_length: "La taille minimale d'un message avant que l'on vérifie l'existence de discussions identiques"
category_colors: "Une liste de couleurs autorisées pour les catégories (au format hexadécimal, séparés par un |)" category_colors: "Une liste de couleurs autorisées pour les catégories (au format hexadécimal, séparés par un |)"
enable_wide_category_list: "Activer pleine largeur, sans cadrillage, liste des catégories"
max_image_size_kb: "La taille maximale des images que nous permettons aux utilisateurs d'envoyer (en Ko) - configure la limite dans nginx (client_max_body_size) / apache ou proxy aussi." max_image_size_kb: "La taille maximale des images que nous permettons aux utilisateurs d'envoyer (en Ko) - configure la limite dans nginx (client_max_body_size) / apache ou proxy aussi."
max_attachment_size_kb: "La taille maximale des fichiers que nous permettons aux utilisateurs d'envoyer (en Ko) - configure la limite dans nginx (client_max_body_size) / apache ou proxy aussi." max_attachment_size_kb: "La taille maximale des fichiers que nous permettons aux utilisateurs d'envoyer (en Ko) - configure la limite dans nginx (client_max_body_size) / apache ou proxy aussi."
authorized_extensions: "Une liste d'extensions de fichier autorisées pour les envois de fichiers (séparés par un |)" authorized_extensions: "Une liste d'extensions de fichier autorisées pour les envois de fichiers (séparés par un |)"

View File

@ -670,7 +670,6 @@ ko:
min_body_similar_length: "The minimum length of a post's body before it will be checked for similar topics" min_body_similar_length: "The minimum length of a post's body before it will be checked for similar topics"
category_colors: "A pipe (|) separated list of hexadecimal color values allowed for categories" category_colors: "A pipe (|) separated list of hexadecimal color values allowed for categories"
enable_wide_category_list: "Enable traditional full width, non-tiling, category list"
max_image_size_kb: "사용자가 업로드 할 수 있는 이미지 최대 kB 사이즈 - nginx(client_max_body_size), apache, proxy 역시 설정해야함" max_image_size_kb: "사용자가 업로드 할 수 있는 이미지 최대 kB 사이즈 - nginx(client_max_body_size), apache, proxy 역시 설정해야함"
max_attachment_size_kb: "사용자가 업로드 할 수 있는 파일 최대 kB 사이즈 - nginx(client_max_body_size), apache, proxy 역시 설정해야함" max_attachment_size_kb: "사용자가 업로드 할 수 있는 파일 최대 kB 사이즈 - nginx(client_max_body_size), apache, proxy 역시 설정해야함"

View File

@ -683,7 +683,6 @@ nl:
min_body_similar_length: De minimale lengte die de inhoud van een bericht moet hebben voordat er wordt gezocht naar vergelijkbare topics min_body_similar_length: De minimale lengte die de inhoud van een bericht moet hebben voordat er wordt gezocht naar vergelijkbare topics
category_colors: "Een lijst, gescheiden door een pipe (|), van hexadecimal kleurwaardes die gebruikt kunnen worden voor categorien" category_colors: "Een lijst, gescheiden door een pipe (|), van hexadecimal kleurwaardes die gebruikt kunnen worden voor categorien"
enable_wide_category_list: "Activeer traditionele volle breedte, non-tiling, categorielijst"
max_image_size_kb: "De maximale afbeeldingsgrootte die we toestaan voor uploads, in kB. Zorg er voor dat deze limiet ook ingesteld is in nginx (client_max_body_size) / apache of een proxy." max_image_size_kb: "De maximale afbeeldingsgrootte die we toestaan voor uploads, in kB. Zorg er voor dat deze limiet ook ingesteld is in nginx (client_max_body_size) / apache of een proxy."
max_attachment_size_kb: "De maximale bestandsgrootte die we toestaan voor uploads, in kB. Zorg er voor dat deze limiet ook ingesteld is in nginx (client_max_body_size) / apache of een proxy." max_attachment_size_kb: "De maximale bestandsgrootte die we toestaan voor uploads, in kB. Zorg er voor dat deze limiet ook ingesteld is in nginx (client_max_body_size) / apache of een proxy."

View File

@ -874,9 +874,6 @@ pseudo:
ƀé čĥéčǩéď ƒóř šíɱíłář ťóƿíčš ]]' ƀé čĥéčǩéď ƒóř šíɱíłář ťóƿíčš ]]'
category_colors: '[[ Á ƿíƿé (|) šéƿářáťéď łíšť óƒ ĥéхáďéčíɱáł čółóř νáłůéš áłłóŵéď category_colors: '[[ Á ƿíƿé (|) šéƿářáťéď łíšť óƒ ĥéхáďéčíɱáł čółóř νáłůéš áłłóŵéď
ƒóř čáťéǧóříéš ]]' ƒóř čáťéǧóříéš ]]'
enable_wide_category_list: '[[ Éɳáƀłé ťřáďíťíóɳáł ƒůłł ŵíďťĥ, ɳóɳ-ťíłíɳǧ, čáťéǧóřý
łíšť. ЍÓŤÉ: ťĥíš šéťťíɳǧ čůřřéɳťłý ďóéš ɳóťĥíɳǧ áɳď ŵíłł ƀé řéɱóνéď. Ŵíďé łíšť
íš ťĥé óɳłý óƿťíóɳ ɳóŵ. ]]'
max_image_size_kb: '[[ Ťĥé ɱáхíɱůɱ šížé óƒ íɱáǧéš ŵé áłłóŵ ůšéřš ťó ůƿłóáď íɳ max_image_size_kb: '[[ Ťĥé ɱáхíɱůɱ šížé óƒ íɱáǧéš ŵé áłłóŵ ůšéřš ťó ůƿłóáď íɳ
ǩƁ - čóɳƒíǧůřé ťĥé łíɱíť íɳ ɳǧíɳх (čłíéɳť_ɱáх_ƀóďý_šížé) / áƿáčĥé óř ƿřóхý áš ǩƁ - čóɳƒíǧůřé ťĥé łíɱíť íɳ ɳǧíɳх (čłíéɳť_ɱáх_ƀóďý_šížé) / áƿáčĥé óř ƿřóхý áš
ŵéłł. ]]' ŵéłł. ]]'

View File

@ -662,7 +662,6 @@ pt_BR:
min_body_similar_length: "Tamanho mínimo do corpo de uma postagem antes de ele ser checado por tópicos similares" min_body_similar_length: "Tamanho mínimo do corpo de uma postagem antes de ele ser checado por tópicos similares"
category_colors: "Lista separada por barra (|) das cores em hexadecimal permitidas para as categorias" category_colors: "Lista separada por barra (|) das cores em hexadecimal permitidas para as categorias"
enable_wide_category_list: "Habilitar lista de categorias tradicional com largura total"
max_image_size_kb: "Tamanho máximo de imagens que os usuários podem enviar em kB - certifique-se de configurar o limite no nginx (client_max_body_size) / apache, e também no proxy." max_image_size_kb: "Tamanho máximo de imagens que os usuários podem enviar em kB - certifique-se de configurar o limite no nginx (client_max_body_size) / apache, e também no proxy."
max_attachment_size_kb: "Tamanho máximo de arquivos que os usuários podem enviar em kB - certifique-se de configurar o limite no nginx (client_max_body_size) / apache, e também no proxy." max_attachment_size_kb: "Tamanho máximo de arquivos que os usuários podem enviar em kB - certifique-se de configurar o limite no nginx (client_max_body_size) / apache, e também no proxy."

View File

@ -641,7 +641,6 @@ ru:
min_title_similar_length: 'Минимальная длина названия темы, при которой тема будет проверена на наличие похожих' min_title_similar_length: 'Минимальная длина названия темы, при которой тема будет проверена на наличие похожих'
min_body_similar_length: 'Минимальная длина тела сообщения, при которой оно будет проверено на наличие похожих тем' min_body_similar_length: 'Минимальная длина тела сообщения, при которой оно будет проверено на наличие похожих тем'
category_colors: 'Разделенный чертой (|) список дозволенных hexadecimal цветов для категорий' category_colors: 'Разделенный чертой (|) список дозволенных hexadecimal цветов для категорий'
enable_wide_category_list: 'Использовать обычный полноразмерный список категорий. ВНИМАНИЕ: на текущий момент данная настройка ничего не делает и в скором времени будет удалена. Полноразмерный список является единственно возможным.'
max_image_size_kb: 'Максимальный размер изображений для загрузки пользователем в КБ убедитесь, что вы так же настроили лимит в nginx (client_max_body_size) / apache или прокси.' max_image_size_kb: 'Максимальный размер изображений для загрузки пользователем в КБ убедитесь, что вы так же настроили лимит в nginx (client_max_body_size) / apache или прокси.'
max_attachment_size_kb: 'Максимальный размер файлов для загрузки пользователем в кб убедитесь, что вы настроили лимит также в nginx (client_max_body_size) / apache или proxy.' max_attachment_size_kb: 'Максимальный размер файлов для загрузки пользователем в кб убедитесь, что вы настроили лимит также в nginx (client_max_body_size) / apache или proxy.'
authorized_extensions: 'Список расширений файлов, разрешенных к загрузке, разделенный вертикальной чертой (|)' authorized_extensions: 'Список расширений файлов, разрешенных к загрузке, разделенный вертикальной чертой (|)'

View File

@ -30,9 +30,6 @@ basic:
ga_domain_name: ga_domain_name:
client: true client: true
default: '' default: ''
enable_wide_category_list:
client: true
default: true
category_featured_topics: category_featured_topics:
client: true client: true
default: 3 default: 3

View File

@ -0,0 +1,9 @@
class RemoveEnableWideCategoryList < ActiveRecord::Migration
def up
execute "DELETE FROM site_settings WHERE name = 'enable_wide_category_list'"
end
def down
# Nothing. Default site setting value will be used.
end
end