15
15
?>
16
16
<?php $ _product = $ block ->getProduct ()?>
17
17
<?php $ block ->getConfigJson () ?>
18
- <div class="form-inline">
19
- <div class="field">
20
- <label class="label" for="name"><span><?php echo __ ('Title ' )?> </span></label>
21
- <div class="control">
22
- <input type="text" class="input-text" id="downloadable_links_title" name="product[links_title]" value="<?php echo $ block ->getLinksTitle () ?> " <?php echo ($ _product ->getStoreId () && $ block ->getUsedDefault ()) ? 'disabled="disabled" ' : '' ?> >
23
- <?php if ($ _product ->getStoreId ()): ?>
24
- <input id="link_title_default" type="checkbox" name="use_default[]" value="links_title" onclick="toggleValueElements(this, this.parentNode.parentNode)" <?php echo $ block ->getUsedDefault () ? 'checked="checked" ' : '' ?> />
25
- <label class="normal" for="link_title_default"><?php echo __ ('Use Default Value ' ); ?> </label>
26
- <?php endif ; ?>
27
- </div>
28
- <div class="field-service">
29
- <?php echo !$ block ->isSingleStoreMode () ? __ ('[STORE VIEW] ' ) : '' ; ?>
18
+ <div class="admin__scope">
19
+ <fieldset class="admin__fieldset downloadable-form">
20
+
21
+ <div class="admin__field" <?php echo !$ block ->isSingleStoreMode () ? ' data-config-scope=" ' . __ ('[STORE VIEW] ' ) . '" ' : '' ; ?> >
22
+ <label class="admin__field-label" for="downloadable_links_title"><span><?php echo __ ('Title ' )?> </span></label>
23
+ <div class="admin__field-control">
24
+ <input type="text" class="admin__control-text" id="downloadable_links_title" name="product[links_title]" value="<?php echo $ block ->getLinksTitle () ?> " <?php echo ($ _product ->getStoreId () && $ block ->getUsedDefault ()) ? 'disabled="disabled" ' : '' ?> >
25
+ <?php if ($ _product ->getStoreId ()): ?>
26
+ <div class="admin__field admin__field-option">
27
+ <input id="link_title_default" class="admin__control-checkbox" type="checkbox" name="use_default[]" value="links_title" onclick="toggleValueElements(this, this.parentNode.parentNode)" <?php echo $ block ->getUsedDefault () ? 'checked="checked" ' : '' ?> />
28
+ <label class="admin__field-label" for="link_title_default"><span><?php echo __ ('Use Default Value ' ); ?> </span></label>
29
+ </div>
30
+ <?php endif ; ?>
31
+ </div>
30
32
</div>
31
- </div>
32
33
33
- <div class="field">
34
- <label class="label" for="name"><span><?php echo __ ('Links can be purchased separately ' )?> </span></label>
35
- <div class="control">
36
- <?php echo $ block ->getPurchasedSeparatelySelect ()?>
34
+ <div class="admin__field" <?php echo !$ block ->isSingleStoreMode () ? ' data-config-scope=" ' . __ ('[GLOBAL] ' ) . '" ' : '' ; ?> >
35
+ <label class="admin__field-label" for="downloadable_link_purchase_type"><span><?php echo __ ('Links can be purchased separately ' )?> </span></label>
36
+ <div class="admin__field-control">
37
+ <?php echo $ block ->getPurchasedSeparatelySelect ()?>
38
+ </div>
37
39
</div>
38
- <div class="field-service">
39
- <?php echo !$ block ->isSingleStoreMode () ? __ ('[GLOBAL] ' ) : '' ; ?>
40
+ <div class="admin__field admin__field-wide">
41
+ <div class="admin__field-control">
42
+ <div class="admin__control-table-wrapper">
43
+ <table cellspacing="0" class="admin__control-table">
44
+ <thead>
45
+ <tr>
46
+ <th class="col-title _required"><span><?php echo __ ('Title ' ) ?> </span></th>
47
+ <?php if ($ block ->getCanReadPrice () !== false ) : ?>
48
+ <th class="col-price"><span><?php echo __ ('Price ' ) ?> </span></th>
49
+ <?php endif ; ?>
50
+ <th class="col-limit"><span><?php echo __ ('Max. Downloads ' ) ?> </span></th>
51
+ <th class="col-option"><span><?php echo __ ('Shareable ' ) ?> </span></th>
52
+ <th class="col-sample"><span><?php echo __ ('Sample ' ) ?> </span></th>
53
+ <th class="col-file"><span><?php echo __ ('File ' ) ?> </span></th>
54
+ <th class="col-sort"><span><?php echo __ ('Sort Order ' ) ?> </span></th>
55
+ <th class="col-actions"> </th>
56
+ </tr>
57
+ </thead>
58
+ <tfoot>
59
+ <tr>
60
+ <td class="col-actions-add" colspan="8"><?php echo $ block ->getAddButtonHtml () ?> </td>
61
+ </tr>
62
+ </tfoot>
63
+ <tbody id="link_items_body">
64
+ </tbody>
65
+ </table>
66
+ </div>
67
+ <div class="admin__field-note">
68
+ <span><?php echo __ ('Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with \'_ \'. ' )?> </span>
69
+ </div>
70
+ </div>
40
71
</div>
41
- </div>
42
-
43
- <table cellspacing="0" class="data-table">
44
- <thead>
45
- <tr>
46
- <th><?php echo __ ('Title ' )?> <span class="required">*</span></th>
47
- <?php if ($ block ->getCanReadPrice () !== false ) : ?>
48
- <th><?php echo __ ('Price ' )?> </th>
49
- <?php endif ; ?>
50
- <th><?php echo __ ('Max. Downloads ' )?> </th>
51
- <th><?php echo __ ('Shareable ' )?> </th>
52
- <th><?php echo __ ('Sample ' )?> </th>
53
- <th><?php echo __ ('File ' )?> </th>
54
- <th><?php echo __ ('Sort Order ' )?> </th>
55
- <th class="col-delete"> </th>
56
- </tr>
57
- </thead>
58
- <tfoot>
59
- <tr>
60
- <td colspan="8" class="col-actions-add"><?php echo $ block ->getAddButtonHtml ()?> </td>
61
- </tr>
62
- </tfoot>
63
- <tbody id="link_items_body">
64
- </tbody>
65
- </table>
66
-
67
- <div><small><?php echo __ ('Alphanumeric, dash and underscore characters are recommended for filenames. Improper characters are replaced with \'_ \'. ' )?> </small></div>
68
-
69
-
72
+ </fieldset>
70
73
</div>
71
74
<script>
72
75
require([
@@ -79,15 +82,15 @@ require([
79
82
], function(jQuery, registry, mageTemplate){
80
83
registry.get('downloadable', function (Downloadable) {
81
84
var linkTemplate = '<tr>'+
82
- '<td>'+
85
+ '<td class="col-title" >'+
83
86
'<input type="hidden" class="__delete__" name="downloadable[link][<%- data.id %>][is_delete]" value="" />'+
84
87
'<input type="hidden" name="downloadable[link][<%- data.id %>][link_id]" value="<%- data.link_id %>" />'+
85
- '<input type="text" class="required-entry input-text" name="downloadable[link][<%- data.id %>][title]" value="<%- data.title %>" />'+
88
+ '<input type="text" class="required-entry input-text admin__control-text " name="downloadable[link][<%- data.id %>][title]" value="<%- data.title %>" />'+
86
89
'<?php echo $ _product ->getStoreId () ? '<input type="checkbox" id="downloadable_link_<%- data.id %>_title" name="downloadable[link][<%- data.id %>][use_default_title]" value="1" /><label class="normal" for="downloadable_link_<%- data.id %>_title">Use Default Value</label> ' : '' ?> '+
87
90
'</td>'+
88
91
<?php if ($ block ->getCanReadPrice () !== false ) : ?>
89
- '<td class="input-price">'+
90
- '<input type="text" id="downloadable_link_<%- data.id %>_price_value" class="input-text validate-number link-prices<?php if ($ block ->getCanEditPrice () === false ) : ?> disabled<?php endif ; ?> " name="downloadable[link][<%- data.id %>][price]" value="<%- data.price %>"<?php if ($ block ->getCanEditPrice () === false ) : ?> disabled="disabled"<?php endif ; ?> /> ' +
92
+ '<td class="input-price col-price ">'+
93
+ '<input type="text" id="downloadable_link_<%- data.id %>_price_value" class="input-text admin__control-text validate-number link-prices<?php if ($ block ->getCanEditPrice () === false ) : ?> disabled<?php endif ; ?> " name="downloadable[link][<%- data.id %>][price]" value="<%- data.price %>"<?php if ($ block ->getCanEditPrice () === false ) : ?> disabled="disabled"<?php endif ; ?> /> ' +
91
94
'<label>[<?php echo $ block ->getBaseCurrencyCode ($ _product ->getStoreId ()) ?> ]</label>' +
92
95
<?php if ($ _product ->getStoreId () && $ block ->getIsPriceWebsiteScope ()) : ?>
93
96
'<br /><input type="checkbox" id="downloadable_link_<%- data.id %>_price" name="downloadable[link][<%- data.id %>][use_default_price]" value="1"<?php if ($ block ->getCanEditPrice () === false ) : ?> disabled="disabled"<?php endif ; ?> /> <label for="downloadable_link_<%- data.id %>_price">Use Default Value</label>' +
@@ -99,16 +102,16 @@ require([
99
102
'<input type="hidden" id="downloadable_link_<%- data.id %>_price" name="downloadable[link][<%- data.id %>][use_default_price]" value="1" />' +
100
103
<?php endif ; ?>
101
104
<?php endif ; ?>
102
- '<td><input type="text" id="downloadable_link_<%- data.id %>_downloads" name="downloadable[link][<%- data.id %>][number_of_downloads]" class="input-text downloads" value="<%- data.number_of_downloads %>" />'+
105
+ '<td class="col-limit" ><input type="text" id="downloadable_link_<%- data.id %>_downloads" name="downloadable[link][<%- data.id %>][number_of_downloads]" class="input-text admin__control -text downloads" value="<%- data.number_of_downloads %>" />'+
103
106
'<p><input type="checkbox" class="checkbox" id="downloadable_link_<%- data.id %>_is_unlimited" name="downloadable[link][<%- data.id %>][is_unlimited]" value="1" <%- data.is_unlimited %> /> <label for="downloadable_link_<%- data.id %>_is_unlimited">Unlimited</label></p></td>'+
104
- '<td>'+
107
+ '<td class="col-share" >'+
105
108
'<select id="downloadable_link _<%- data.id %>_shareable" name="downloadable[link][<%- data.id %>][is_shareable]">'+
106
109
'<option value="1">Yes</option>'+
107
110
'<option value="0">No</option>'+
108
111
'<option value="2" selected="selected">Use config</option>'+
109
112
'</select>'+
110
113
'</td>'+
111
- '<td>'+
114
+ '<td class="col-file" >'+
112
115
'<div class="files">'+
113
116
'<div class="row">'+
114
117
'<label for="downloadable_link_<%- data.id %>_sample_file_type"><input type="radio" class="radio" id="downloadable_link_<%- data.id %>_sample_file_type" name="downloadable[link][<%- data.id %>][sample][type]" value="file"<%- data.sample_file_checked %> /> File:</label>'+
@@ -127,14 +130,14 @@ require([
127
130
'</div>'+
128
131
'</div>'+
129
132
'<div class="row">'+
130
- '<label for="downloadable_link_<%- data.id %>_sample_url_type"><input type="radio" class="radio" id="downloadable_link_<%- data.id %>_sample_url_type" name="downloadable[link][<%- data.id %>][sample][type]" value="url"<%- data.sample_url_checked %> /> URL:</label><input type="text" class="input-text validate-downloadable-url validate-url" name="downloadable[link][<%- data.id %>][sample][url]" value="<%- data.sample_url %>" />'+
133
+ '<label for="downloadable_link_<%- data.id %>_sample_url_type"><input type="radio" class="radio" id="downloadable_link_<%- data.id %>_sample_url_type" name="downloadable[link][<%- data.id %>][sample][type]" value="url"<%- data.sample_url_checked %> /> URL:</label><input type="text" class="input-text admin__control-text validate-downloadable-url validate-url" name="downloadable[link][<%- data.id %>][sample][url]" value="<%- data.sample_url %>" />'+
131
134
'</div>'+
132
135
'<div>'+
133
136
'<span id="downloadable_link_<%- data.id %>_sample_container"></span>'+
134
137
'</div>'+
135
138
'</div>'+
136
139
'</td>'+
137
- '<td>'+
140
+ '<td class="col-file" >'+
138
141
'<div class="files">'+
139
142
'<div class="row">'+
140
143
'<label for="downloadable_link_<%- data.id %>_file_type"><input type="radio" class="radio validate-one-required-by-name" id="downloadable_link_<%- data.id %>_file_type" name="downloadable[link][<%- data.id %>][type]" value="file"<%- data.file_checked %> /> File:</label>'+
@@ -153,16 +156,16 @@ require([
153
156
'</div>'+
154
157
'</div>'+
155
158
'<div class="row">'+
156
- '<label for="downloadable_link_<%- data.id %>_url_type"><input type="radio" class="radio validate-one-required-by-name" id="downloadable_link_<%- data.id %>_url_type" name="downloadable[link][<%- data.id %>][type]" value="url"<%- data.url_checked %> /> URL:</label><input type="text" class="validate-downloadable-url validate-url input-text" name="downloadable[link][<%- data.id %>][link_url]" value="<%- data.link_url %>" />'+
159
+ '<label for="downloadable_link_<%- data.id %>_url_type"><input type="radio" class="radio validate-one-required-by-name" id="downloadable_link_<%- data.id %>_url_type" name="downloadable[link][<%- data.id %>][type]" value="url"<%- data.url_checked %> /> URL:</label><input type="text" class="validate-downloadable-url validate-url input-text admin__control-text " name="downloadable[link][<%- data.id %>][link_url]" value="<%- data.link_url %>" />'+
157
160
'</div>'+
158
161
'<div>'+
159
162
'<span id="downloadable_link_<%- data.id %>_link_container"></span>'+
160
163
'</div>'+
161
164
'</div>'+
162
165
'</td>'+
163
- '<td><input type="text" name="downloadable[link][<%- data.id %>][sort_order]" value="<%- data.sort_order %>" class="input-text sort" /></td>'+
164
- '<td class="col-delete ">'+
165
- '<button id="downloadable_link_<%- data.id %>_delete_button" type="button" class="action- scalable delete delete-link-item "><span><span><span> < ?php echo __ ('Delete ' ); ?> </span></span ></span></button>'+
166
+ '<td class="col-sort" ><input type="text" name="downloadable[link][<%- data.id %>][sort_order]" value="<%- data.sort_order %>" class="input-text admin__control -text sort" /></td>'+
167
+ '<td class="col-action ">'+
168
+ '<button id="downloadable_link_<%- data.id %>_delete_button" type="button" class="action-remove "><span><?php echo __ ('Delete ' ); ?> </span></button>'+
166
169
'</td>'+
167
170
'</tr>';
168
171
@@ -309,7 +312,7 @@ require([
309
312
}
310
313
},
311
314
bindRemoveButtons : function(){
312
- var buttons = $$('tbody#link_items_body .delete-link-item ');
315
+ var buttons = $$('tbody#link_items_body .action-remove ');
313
316
for(var i=0;i<buttons.length;i++){
314
317
if(!$(buttons[i]).binded && !$(buttons[i]).hasClassName('disabled')){
315
318
$(buttons[i]).binded = true;
@@ -351,7 +354,7 @@ require([
351
354
if ($(id + ' .progressbar-container').length) {
352
355
$(id + ' .progressbar-container').parent().remove();
353
356
}
354
-
357
+
355
358
fileSize = typeof file.size == "undefined" ?
356
359
$.mage.__('We could not detect a size.') :
357
360
byteConvert(file.size);
0 commit comments