REMOVE: Get rid of the `hotness` control for good.

This commit is contained in:
Robin Ward 2014-01-29 11:54:34 -05:00
parent 79b8269aa0
commit 2892153712
31 changed files with 11 additions and 137 deletions

View File

@ -62,7 +62,6 @@ Discourse.Category = Discourse.Model.extend({
name: this.get('name'), name: this.get('name'),
color: this.get('color'), color: this.get('color'),
text_color: this.get('text_color'), text_color: this.get('text_color'),
hotness: this.get('hotness'),
secure: this.get('secure'), secure: this.get('secure'),
permissions: this.get('permissionsForUpdate'), permissions: this.get('permissionsForUpdate'),
auto_close_hours: this.get('auto_close_hours'), auto_close_hours: this.get('auto_close_hours'),

View File

@ -36,7 +36,7 @@ Discourse.DiscoveryCategoriesRoute = Discourse.Route.extend({
actions: { actions: {
createCategory: function() { createCategory: function() {
Discourse.Route.showModal(this, 'editCategory', Discourse.Category.create({ Discourse.Route.showModal(this, 'editCategory', Discourse.Category.create({
color: 'AB9364', text_color: 'FFFFFF', hotness: 5, group_permissions: [{group_name: 'everyone', permission_type: 1}], color: 'AB9364', text_color: 'FFFFFF', group_permissions: [{group_name: 'everyone', permission_type: 1}],
available_groups: Discourse.Site.current().group_names available_groups: Discourse.Site.current().group_names
})); }));
this.controllerFor('editCategory').set('selectedTab', 'general'); this.controllerFor('editCategory').set('selectedTab', 'general');

View File

@ -107,11 +107,6 @@
{{i18n category.default_position}} {{i18n category.default_position}}
</button> </button>
</section> </section>
<section class='field'>
<label>{{i18n category.hotness}}</label>
{{view Discourse.HotnessView hotnessBinding="hotness"}}
</section>
</div> </div>
{{/unless}} {{/unless}}
</div> </div>

View File

@ -1,43 +0,0 @@
/**
This will render a control to edit the `hotness` of a thing. This would be really
cool to use with a shadow DOM.
@class HotnessView
@extends Discourse.View
@namespace Discourse
@module Discourse
**/
Discourse.HotnessView = Discourse.View.extend({
classNames: ['hotness-control'],
shouldRerender: Discourse.View.renderIfChanged('hotness'),
render: function(buffer) {
// Our scale goes to 11!
for (var i=1; i<12; i++) {
buffer.push("<button value='" + i + "'");
if (this.get('hotness') === i) {
buffer.push(" class='selected'");
}
buffer.push(">" + i + "</button>");
}
},
/**
When the user clicks on a hotness value button, change it.
@method click
**/
click: function(e) {
var $target = $(e.target);
if (!$target.is('button')) return;
this.set('hotness', parseInt($target.val(), 10));
return false;
}
});

View File

@ -1,29 +0,0 @@
// styles for the 'hotness control'
@import "common/foundation/variables";
@import "common/foundation/mixins";
.hotness-control {
margin-bottom: 5px;
button {
@include border-radius-all(5px);
margin-right: 3px;
background-color: lighten($gray, 10%);
border: 0;
width: 25px;
text-align: center;
&:hover {
background-color: $gray;
}
}
button.selected {
background-color: lighten($red, 25%);
color: $white;
font-weight: bold;
}
}

View File

@ -1,29 +0,0 @@
// styles for the 'hotness control'
@import "../common/foundation/variables";
@import "../common/foundation/mixins";
.hotness-control {
margin-bottom: 5px;
button {
@include border-radius-all(5px);
margin-right: 3px;
background-color: lighten($gray, 10%);
border: 0;
width: 25px;
text-align: center;
&:hover {
background-color: $gray;
}
}
button.selected {
background-color: lighten($red, 25%);
color: $white;
font-weight: bold;
}
}

View File

@ -90,7 +90,7 @@ class CategoriesController < ApplicationController
end end
end end
params.permit(*required_param_keys, :position, :hotness, :parent_category_id, :auto_close_hours, :permissions => [*p.try(:keys)]) params.permit(*required_param_keys, :position, :parent_category_id, :auto_close_hours, :permissions => [*p.try(:keys)])
end end
end end

View File

@ -362,7 +362,6 @@ end
# slug :string(255) not null # slug :string(255) not null
# description :text # description :text
# text_color :string(6) default("FFFFFF"), not null # text_color :string(6) default("FFFFFF"), not null
# hotness :float default(5.0), not null
# read_restricted :boolean default(FALSE), not null # read_restricted :boolean default(FALSE), not null
# auto_close_hours :float # auto_close_hours :float
# post_count :integer default(0), not null # post_count :integer default(0), not null

View File

@ -8,7 +8,6 @@ class BasicCategorySerializer < ApplicationSerializer
:topic_count, :topic_count,
:description, :description,
:topic_url, :topic_url,
:hotness,
:read_restricted, :read_restricted,
:permission, :permission,
:parent_category_id :parent_category_id

View File

@ -936,7 +936,6 @@ cs:
list: "Seznam kategorií" list: "Seznam kategorií"
no_description: "K této kategorii zatím není žádný popis." no_description: "K této kategorii zatím není žádný popis."
change_in_category_topic: "navštivte téma kategorie pro editaci jejího popisu" change_in_category_topic: "navštivte téma kategorie pro editaci jejího popisu"
hotness: "Popularita"
already_used: 'Tato barva je již použita jinou kategorií' already_used: 'Tato barva je již použita jinou kategorií'
security: "Bezpečnost" security: "Bezpečnost"
auto_close_label: "Automaticky zavírat témata po:" auto_close_label: "Automaticky zavírat témata po:"

View File

@ -1011,7 +1011,6 @@ da:
list: "Kategoriliste" list: "Kategoriliste"
no_description: "Der er ingen beskrivelse for denne kategori." no_description: "Der er ingen beskrivelse for denne kategori."
change_in_category_topic: "besøg kategoriemnet for at redigere beskrivelsen" change_in_category_topic: "besøg kategoriemnet for at redigere beskrivelsen"
hotness: "Popularitet"
already_used: 'This color has been used by another category' already_used: 'This color has been used by another category'
security: "Sikkerhed" security: "Sikkerhed"
auto_close_label: "Luk automatisk emner efter:" auto_close_label: "Luk automatisk emner efter:"

View File

@ -929,7 +929,6 @@ de:
list: "Kategorien auflisten" list: "Kategorien auflisten"
no_description: "Es gibt keine Beschreibung zu dieser Kategorie." no_description: "Es gibt keine Beschreibung zu dieser Kategorie."
change_in_category_topic: "Besuche die Themen dieser Kategorie um einen Eindruck für eine gute Beschreibung zu gewinnen." change_in_category_topic: "Besuche die Themen dieser Kategorie um einen Eindruck für eine gute Beschreibung zu gewinnen."
hotness: "Beliebtheit"
already_used: 'Diese Farbe wird bereits für eine andere Kategorie verwendet' already_used: 'Diese Farbe wird bereits für eine andere Kategorie verwendet'
security: "Sicherheit" security: "Sicherheit"
auto_close_label: "Thema automatisch schließen nach:" auto_close_label: "Thema automatisch schließen nach:"

View File

@ -1028,7 +1028,6 @@ en:
list: "List Categories" list: "List Categories"
no_description: "There is no description for this category, edit the topic definition." no_description: "There is no description for this category, edit the topic definition."
change_in_category_topic: "Edit Description" change_in_category_topic: "Edit Description"
hotness: "Hotness"
already_used: 'This color has been used by another category' already_used: 'This color has been used by another category'
security: "Security" security: "Security"
auto_close_label: "Auto-close topics after:" auto_close_label: "Auto-close topics after:"

View File

@ -997,7 +997,6 @@ fr:
list: "Liste des catégories" list: "Liste des catégories"
no_description: "Il n'y a pas de description pour cette catégorie." no_description: "Il n'y a pas de description pour cette catégorie."
change_in_category_topic: "Editer la description" change_in_category_topic: "Editer la description"
hotness: "Buzz"
already_used: 'Cette couleur est déjà utilisée par une autre catégorie' already_used: 'Cette couleur est déjà utilisée par une autre catégorie'
security: "Sécurité" security: "Sécurité"
auto_close_label: "Fermer automatiquement après :" auto_close_label: "Fermer automatiquement après :"

View File

@ -903,7 +903,6 @@ it:
list: "Lista Categorie" list: "Lista Categorie"
no_description: "Nessuna descrizione per questa categoria." no_description: "Nessuna descrizione per questa categoria."
change_in_category_topic: "Modifica Descrizione" change_in_category_topic: "Modifica Descrizione"
hotness: "Hotness"
already_used: "Questo colore è già in uso da un'altra categoria" already_used: "Questo colore è già in uso da un'altra categoria"
is_secure: "Categoria protetta?" is_secure: "Categoria protetta?"
add_group: "Aggiungi Gruppo" add_group: "Aggiungi Gruppo"

View File

@ -938,7 +938,6 @@ ja:
list: "カテゴリをリストする" list: "カテゴリをリストする"
no_description: "このカテゴリの説明はありません。トピック定義を編集してください。" no_description: "このカテゴリの説明はありません。トピック定義を編集してください。"
change_in_category_topic: "カテゴリ内容を編集" change_in_category_topic: "カテゴリ内容を編集"
hotness: "ホット度"
already_used: 'この色は他のカテゴリで利用しています' already_used: 'この色は他のカテゴリで利用しています'
security: "セキュリティ" security: "セキュリティ"
auto_close_label: "" auto_close_label: ""

View File

@ -959,7 +959,6 @@ ko:
list: "카테고리 목록" list: "카테고리 목록"
no_description: "이 카테고리에 대한 설명이 없습니다." no_description: "이 카테고리에 대한 설명이 없습니다."
change_in_category_topic: "설명 편집" change_in_category_topic: "설명 편집"
hotness: "활발한"
already_used: '이 색은 다른 카테고리에서 사용되고 있습니다.' already_used: '이 색은 다른 카테고리에서 사용되고 있습니다.'
security: "보안" security: "보안"
auto_close_label: "토픽 자동 닫기 :" auto_close_label: "토픽 자동 닫기 :"

View File

@ -800,7 +800,6 @@ nb_NO:
list: "List Kategorier" list: "List Kategorier"
no_description: "Det er ingen beskrivelse på denne kategorien." no_description: "Det er ingen beskrivelse på denne kategorien."
change_in_category_topic: "Rediger Beskrivelse" change_in_category_topic: "Rediger Beskrivelse"
hotness: "Temperatur"
already_used: 'Denne fargen er i bruk av en annen kategori' already_used: 'Denne fargen er i bruk av en annen kategori'
is_secure: "Sikker kategori?" is_secure: "Sikker kategori?"
add_group: "Legg til Gruppe" add_group: "Legg til Gruppe"

View File

@ -1019,7 +1019,6 @@ nl:
list: Lijst van categorieën list: Lijst van categorieën
no_description: Er is geen omschrijving voor deze categorie no_description: Er is geen omschrijving voor deze categorie
change_in_category_topic: Wijzig omschrijving change_in_category_topic: Wijzig omschrijving
hotness: Populariteit
already_used: Deze kleur is al in gebruik door een andere categorie already_used: Deze kleur is al in gebruik door een andere categorie
security: Beveiliging security: Beveiliging
auto_close_label: "Sluit topics automatisch na:" auto_close_label: "Sluit topics automatisch na:"

View File

@ -1007,7 +1007,6 @@ pseudo:
no_description: '[[ Ťĥéřé íš ɳó ďéščříƿťíóɳ ƒóř ťĥíš čáťéǧóřý, éďíť ťĥé ťóƿíč no_description: '[[ Ťĥéřé íš ɳó ďéščříƿťíóɳ ƒóř ťĥíš čáťéǧóřý, éďíť ťĥé ťóƿíč
ďéƒíɳíťíóɳ. ]]' ďéƒíɳíťíóɳ. ]]'
change_in_category_topic: '[[ Éďíť Ďéščříƿťíóɳ ]]' change_in_category_topic: '[[ Éďíť Ďéščříƿťíóɳ ]]'
hotness: '[[ Ĥóťɳéšš ]]'
already_used: '[[ Ťĥíš čółóř ĥáš ƀééɳ ůšéď ƀý áɳóťĥéř čáťéǧóřý ]]' already_used: '[[ Ťĥíš čółóř ĥáš ƀééɳ ůšéď ƀý áɳóťĥéř čáťéǧóřý ]]'
security: '[[ Šéčůříťý ]]' security: '[[ Šéčůříťý ]]'
auto_close_label: '[[ Áůťó-čłóšé ťóƿíčš áƒťéř: ]]' auto_close_label: '[[ Áůťó-čłóšé ťóƿíčš áƒťéř: ]]'

View File

@ -948,7 +948,6 @@ pt_BR:
list: "Lista de Categorias" list: "Lista de Categorias"
no_description: "Não há descrição para esta categoria, edite a definição do tópico." no_description: "Não há descrição para esta categoria, edite a definição do tópico."
change_in_category_topic: "Editar Descrição" change_in_category_topic: "Editar Descrição"
hotness: "Mais Quente"
already_used: 'Esta cor já foi usada para outra categoria' already_used: 'Esta cor já foi usada para outra categoria'
security: "Segurança" security: "Segurança"
auto_close_label: "Fechar automaticamente tópicos depois de:" auto_close_label: "Fechar automaticamente tópicos depois de:"

View File

@ -1006,7 +1006,6 @@ ru:
list: 'Список категорий' list: 'Список категорий'
no_description: 'Для этой категории нет описания, отредактируйте определение темы.' no_description: 'Для этой категории нет описания, отредактируйте определение темы.'
change_in_category_topic: 'Изменить описание' change_in_category_topic: 'Изменить описание'
hotness: Популярность
already_used: 'Цвет уже используется другой категорией' already_used: 'Цвет уже используется другой категорией'
security: Безопасность security: Безопасность
auto_close_label: 'Закрыть тему через:' auto_close_label: 'Закрыть тему через:'

View File

@ -993,7 +993,6 @@ sv:
list: "Lista Kategorier" list: "Lista Kategorier"
no_description: "Det finns ingen beskrivning för denna kategori." no_description: "Det finns ingen beskrivning för denna kategori."
change_in_category_topic: "besök kategorins tråd för att ändra beskrivning" change_in_category_topic: "besök kategorins tråd för att ändra beskrivning"
hotness: "Hethet"
already_used: 'Den här färgen används till en annan kategori' already_used: 'Den här färgen används till en annan kategori'
security: "Säkerhet" security: "Säkerhet"
auto_close_label: "Stäng trådar automatiskt efter:" auto_close_label: "Stäng trådar automatiskt efter:"

View File

@ -1016,7 +1016,6 @@ zh_CN:
list: "列出分类" list: "列出分类"
no_description: "本分类没有描述信息。" no_description: "本分类没有描述信息。"
change_in_category_topic: "访问分类主题来编辑描述信息" change_in_category_topic: "访问分类主题来编辑描述信息"
hotness: "热度"
already_used: '此色彩已经被另一个分类使用' already_used: '此色彩已经被另一个分类使用'
security: "安全" security: "安全"
auto_close_label: "该时间段后自动关闭主题:" auto_close_label: "该时间段后自动关闭主题:"

View File

@ -1005,7 +1005,6 @@ zh_TW:
list: "列出分類" list: "列出分類"
no_description: "此類別沒有描述,請編輯主題定義。" no_description: "此類別沒有描述,請編輯主題定義。"
change_in_category_topic: "編輯描述" change_in_category_topic: "編輯描述"
hotness: "熱度"
already_used: '此顏色已經用於其它類別' already_used: '此顏色已經用於其它類別'
security: "安全性" security: "安全性"
auto_close_label: "自動關閉主題的期限:" auto_close_label: "自動關閉主題的期限:"

View File

@ -0,0 +1,5 @@
class RemoveCategoryHotness < ActiveRecord::Migration
def change
remove_column :categories, :hotness
end
end

View File

@ -50,7 +50,6 @@ describe CategoriesController do
create_post = CategoryGroup.permission_types[:create_post] create_post = CategoryGroup.permission_types[:create_post]
xhr :post, :create, name: "hello", color: "ff0", text_color: "fff", xhr :post, :create, name: "hello", color: "ff0", text_color: "fff",
hotness: 2,
auto_close_hours: 72, auto_close_hours: 72,
permissions: { permissions: {
"everyone" => readonly, "everyone" => readonly,
@ -64,7 +63,6 @@ describe CategoriesController do
] ]
category.name.should == "hello" category.name.should == "hello"
category.color.should == "ff0" category.color.should == "ff0"
category.hotness.should == 2
category.auto_close_hours.should == 72 category.auto_close_hours.should == 72
end end
end end
@ -152,7 +150,6 @@ describe CategoriesController do
create_post = CategoryGroup.permission_types[:create_post] create_post = CategoryGroup.permission_types[:create_post]
xhr :put, :update, id: @category.id, name: "hello", color: "ff0", text_color: "fff", xhr :put, :update, id: @category.id, name: "hello", color: "ff0", text_color: "fff",
hotness: 2,
auto_close_hours: 72, auto_close_hours: 72,
permissions: { permissions: {
"everyone" => readonly, "everyone" => readonly,
@ -166,7 +163,6 @@ describe CategoriesController do
] ]
@category.name.should == "hello" @category.name.should == "hello"
@category.color.should == "ff0" @category.color.should == "ff0"
@category.hotness.should == 2
@category.auto_close_hours.should == 72 @category.auto_close_hours.should == 72
end end

View File

@ -189,8 +189,6 @@ describe Category do
it 'is created correctly' do it 'is created correctly' do
@category.slug.should == 'amazing-category' @category.slug.should == 'amazing-category'
@category.hotness.should == 5.0
@category.description.should be_blank @category.description.should be_blank
Topic.where(category_id: @category).count.should == 1 Topic.where(category_id: @category).count.should == 1

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long