mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
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:
commit
161709f4f5
4 changed files with 10 additions and 0 deletions
|
@ -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>
|
||||
|
|
|
@ -23,6 +23,9 @@ Template.post_edit.helpers({
|
|||
return category;
|
||||
});
|
||||
},
|
||||
categoriesEnabled: function(){
|
||||
return Categories.find().count();
|
||||
},
|
||||
isApproved: function(){
|
||||
return this.status == STATUS_APPROVED;
|
||||
},
|
||||
|
|
|
@ -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}}
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
Template.post_submit.helpers({
|
||||
categoriesEnabled: function(){
|
||||
return Categories.find().count();
|
||||
},
|
||||
categories: function(){
|
||||
return Categories.find();
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue