Merge pull request #240 from rpullinger/hide-categories-if-not-needed

Only show category list on post submit/edit if there are categories
This commit is contained in:
Sacha Greif 2014-01-30 16:35:48 -08:00
commit 161709f4f5
4 changed files with 10 additions and 0 deletions

View file

@ -24,6 +24,7 @@
<label class="control-label post-form-body">{{i18n "Body"}}</label>
<div class="controls" id="editor"><textarea id="body" value="" class="input-xlarge">{{body}}</textarea></div>
</div>
{{#if categoriesEnabled}}
<div class="control-group post-form-category">
<label class="control-label">{{i18n "Categories"}}</label>
<div class="controls">
@ -34,6 +35,7 @@
{{/each}}
</div>
</div>
{{/if}}
{{#if isAdmin}}
<div class="control-group post-form-sticky">
<label class="control-label">{{i18n "Inactive?"}}</label>

View file

@ -23,6 +23,9 @@ Template.post_edit.helpers({
return category;
});
},
categoriesEnabled: function(){
return Categories.find().count();
},
isApproved: function(){
return this.status == STATUS_APPROVED;
},

View file

@ -14,6 +14,7 @@
<label class="control-label">{{i18n "Body"}}</label>
<div class="controls" id="editor"><textarea id="body" value="" class="input-xlarge"/></div>
</div>
{{#if categoriesEnabled}}
<div class="control-group">
<label class="control-label">{{i18n "Category"}}</label>
<div class="controls">
@ -24,6 +25,7 @@
{{/each}}
</div>
</div>
{{/if}}
{{/constant}}
{{#if isAdmin}}
{{#constant}}

View file

@ -1,4 +1,7 @@
Template.post_submit.helpers({
categoriesEnabled: function(){
return Categories.find().count();
},
categories: function(){
return Categories.find();
},