mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 12:03:35 +08:00
Don't show the upload option if max_attachment_size_kb is 0.
This commit is contained in:
parent
2db3cfb16b
commit
2850279c45
|
@ -8,8 +8,12 @@
|
|||
@module Discourse
|
||||
**/
|
||||
Discourse.UploadSelectorController = Discourse.Controller.extend(Discourse.ModalFunctionality, {
|
||||
local: true,
|
||||
remote: Em.computed.not("local"),
|
||||
local: Em.computed.not("remote"),
|
||||
remote: Em.computed.not("allowLocal"),
|
||||
|
||||
allowLocal: function() {
|
||||
return Discourse.SiteSettings.max_attachment_size_kb > 0;
|
||||
}.property(),
|
||||
|
||||
actions: {
|
||||
useLocal: function() { this.set("local", true); },
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
<div class="modal-body">
|
||||
<div class="radios">
|
||||
<input type="radio" id="local" value="local" name="upload" {{action useLocal}}>
|
||||
<label class="radio" for="local">{{i18n upload_selector.from_my_computer}}</label>
|
||||
{{#if controller.local}}
|
||||
<div class="inputs">
|
||||
<input type="file" id="filename-input"><br>
|
||||
<span class="description">{{unbound view.tip}}</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{#if allowLocal}}
|
||||
<div class="radios">
|
||||
<input type="radio" id="local" value="local" name="upload" {{action useLocal}}>
|
||||
<label class="radio" for="local">{{i18n upload_selector.from_my_computer}}</label>
|
||||
{{#if controller.local}}
|
||||
<div class="inputs">
|
||||
<input type="file" id="filename-input"><br>
|
||||
<span class="description">{{unbound view.tip}}</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="radios">
|
||||
<input type="radio" id="remote" value="remote" name="upload" {{action useRemote}}>
|
||||
<label class="radio" for="remote">{{i18n upload_selector.from_the_web}}</label>
|
||||
|
|
Loading…
Reference in New Issue
Block a user