Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions submit_asset.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- submit
---

{%- assign tags = site.asset_allowed_tags -%}
{%- assign tags = site.asset_allowed_tags | default: site.data.tagindex -%}

{%- capture page_hero_copy -%}
<p>Share your extension, template, tool, or sample with the Defold community. Fill in the key details here and the site will open a prefilled GitHub issue for the final submission.</p>
Expand All @@ -22,18 +22,12 @@

<script type="text/javascript">
function submit_asset() {
var platforms = [];
if (document.getElementById("android").checked) { platforms.push("android"); }
if (document.getElementById("ios").checked) { platforms.push("ios"); }
if (document.getElementById("macos").checked) { platforms.push("macos"); }
if (document.getElementById("windows").checked) { platforms.push("windows"); }
if (document.getElementById("linux").checked) { platforms.push("linux"); }
if (document.getElementById("html5").checked) { platforms.push("html5"); }

var tags = [];
{%- for tag in tags -%}
if (document.getElementById("tag-{{ tag.id }}").checked) { tags.push({{ tag.name | jsonify }}); }
{% endfor %}
var platforms = Array.from(document.querySelectorAll('input[name="platforms"]:checked'), function(input) {
return input.value;
});
var tags = Array.from(document.querySelectorAll('input[name="tags"]:checked'), function(input) {
return input.value;
});

var name = document.getElementById("asset_name").value;
var asset = {
Expand Down Expand Up @@ -127,7 +121,9 @@ <h2>Asset details</h2>
<legend>Tags (select 1-3 most fitting)</legend>
<div class="submit-form-check-grid">
{%- for tag in tags -%}
<label class="submit-form-check" for="tag-{{ tag.id }}"><input type="checkbox" name="tags" value="{{ tag.name }}" id="tag-{{ tag.id }}"><span>{{ tag.name }}</span></label>
{%- assign tag_name = tag.name | default: tag -%}
{%- assign tag_id = tag.id | default: tag_name | slugify -%}
<label class="submit-form-check" for="tag-{{ tag_id }}"><input type="checkbox" name="tags" value="{{ tag_name | escape }}" id="tag-{{ tag_id }}"><span>{{ tag_name | escape }}</span></label>
{%- endfor -%}
</div>
</fieldset>
Expand Down