Last active
August 29, 2015 14:18
-
-
Save bambuchaAdm/33ec3bcdb37f0041579e to your computer and use it in GitHub Desktop.
Some JS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function($){ | |
| function formLine(number){ | |
| return "<tr class='config-entry'><td headers='name'>" + number + "</td> \ | |
| <td headers='group'> \ | |
| <input class='text medium-field' type='text' id='group-name' name='" + number + ".groupName' value='{$config.groupName}'> \ | |
| </td> \ | |
| <td class='count'> \ | |
| <input class='text medium-field' type='number' id='group-count' name='" + number + ".reviewersCount' value=''> \ | |
| </td> \ | |
| </tr>" | |
| } | |
| $("#ra-add-button").on('clock', function(){ | |
| var nextId = $(".config-entry").length + 1 | |
| $('#ra-config-body:last').after(formLine(nextId)) | |
| }); | |
| })(AJS.$) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <tbody id="ra-config-body"> | |
| {foreach $config in $configuration } | |
| <tr class="config-entry"> | |
| <td headers="name">{index($config)}</td> | |
| <td headers="group"> | |
| {if $config.groupName } | |
| <input class="text medium-field" type="text" id="group-name" name="{index($config)}.groupName" value="{$config.groupName}"> | |
| {else} | |
| <span>Whole users<span> | |
| <input class="text medium-filed" type="hidden" id="group-name" name="{index($config)}.groupName" value=""> | |
| {/if} | |
| </td> | |
| <td class="count"> | |
| <input class="text medium-field" type="number" id="group-count" name="{index($config)}.reviewersCount" value="{$config.reviewersCount}"> | |
| </td> | |
| </tr> | |
| {/foreach} | |
| </tbody> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment