mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 05:23:43 +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
|
@module Discourse
|
||||||
**/
|
**/
|
||||||
Discourse.UploadSelectorController = Discourse.Controller.extend(Discourse.ModalFunctionality, {
|
Discourse.UploadSelectorController = Discourse.Controller.extend(Discourse.ModalFunctionality, {
|
||||||
local: true,
|
local: Em.computed.not("remote"),
|
||||||
remote: Em.computed.not("local"),
|
remote: Em.computed.not("allowLocal"),
|
||||||
|
|
||||||
|
allowLocal: function() {
|
||||||
|
return Discourse.SiteSettings.max_attachment_size_kb > 0;
|
||||||
|
}.property(),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
useLocal: function() { this.set("local", true); },
|
useLocal: function() { this.set("local", true); },
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="radios">
|
{{#if allowLocal}}
|
||||||
<input type="radio" id="local" value="local" name="upload" {{action useLocal}}>
|
<div class="radios">
|
||||||
<label class="radio" for="local">{{i18n upload_selector.from_my_computer}}</label>
|
<input type="radio" id="local" value="local" name="upload" {{action useLocal}}>
|
||||||
{{#if controller.local}}
|
<label class="radio" for="local">{{i18n upload_selector.from_my_computer}}</label>
|
||||||
<div class="inputs">
|
{{#if controller.local}}
|
||||||
<input type="file" id="filename-input"><br>
|
<div class="inputs">
|
||||||
<span class="description">{{unbound view.tip}}</span>
|
<input type="file" id="filename-input"><br>
|
||||||
</div>
|
<span class="description">{{unbound view.tip}}</span>
|
||||||
{{/if}}
|
</div>
|
||||||
</div>
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
<div class="radios">
|
<div class="radios">
|
||||||
<input type="radio" id="remote" value="remote" name="upload" {{action useRemote}}>
|
<input type="radio" id="remote" value="remote" name="upload" {{action useRemote}}>
|
||||||
<label class="radio" for="remote">{{i18n upload_selector.from_the_web}}</label>
|
<label class="radio" for="remote">{{i18n upload_selector.from_the_web}}</label>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user