Use optgroup instead of own implementation
authorJoshua Rüsweg <josh@bastelstu.be>
Sat, 15 Jul 2017 19:08:28 +0000 (21:08 +0200)
committerJoshua Rüsweg <josh@bastelstu.be>
Sat, 15 Jul 2017 19:08:28 +0000 (21:08 +0200)
See #2315

wcfsetup/install/files/acp/templates/userTrophyAdd.tpl
wcfsetup/install/files/acp/templates/userTrophyList.tpl

index a8210158053629dee82b3789c5eca1162e29de90..335e7040bf7323c6552e7da8105838f3c708eef5 100644 (file)
                                        <option value="0">{lang}wcf.global.noSelection{/lang}</option>
 
                                        {foreach from=$trophyCategories item=category}
-                                               <option value="0" disabled>{$category->getTitle()}</option>
-                                               {foreach from=$category->getTrophies(true) item=trophy}
-                                                       <option value="{@$trophy->trophyID}"{if $trophy->trophyID == $trophyID} selected{/if}{if $trophy->awardAutomatically} disabled{/if}>&nbsp;&nbsp;&nbsp;&nbsp;{$trophy->getTitle()}</option>
-                                               {/foreach}
+                                               <optgroup label="{$category->getTitle()}">
+                                                       {foreach from=$category->getTrophies(true) item=trophy}
+                                                               <option value="{@$trophy->trophyID}"{if $trophy->trophyID == $trophyID} selected{/if}{if $trophy->awardAutomatically} disabled{/if}>{$trophy->getTitle()}</option>
+                                                       {/foreach}
+                                               </optgroup>
                                        {/foreach}
                                </select>
                                {if $errorField == 'trophyID'}
index 6fbfdfa61ec5b055dff481b3e0717ce6e08e784a..e1bf0d4e4081a9d31cd18f45ba342cfab4925c65 100644 (file)
                                                <option value="0">{lang}wcf.global.noSelection{/lang}</option>
                                                
                                                {foreach from=$trophyCategories item=category}
-                                                       <option value="0" disabled>{$category->getTitle()}</option>
-                                                       {foreach from=$category->getTrophies(true) item=trophy}
-                                                               <option value="{@$trophy->trophyID}"{if $trophy->trophyID == $trophyID} selected{/if}>&nbsp;&nbsp;&nbsp;&nbsp;{$trophy->getTitle()}</option>
-                                                       {/foreach}
+                                                       <optgroup label="{$category->getTitle()}">
+                                                               {foreach from=$category->getTrophies(true) item=trophy}
+                                                                       <option value="{@$trophy->trophyID}"{if $trophy->trophyID == $trophyID} selected{/if}{if $trophy->awardAutomatically} disabled{/if}>{$trophy->getTitle()}</option>
+                                                               {/foreach}
+                                                       </optgroup>
                                                {/foreach}
                                        </select>
                                </dd>
 {hascontent}
        <div class="paginationTop">
                {content}
-               {assign var='linkParameters' value=''}
+                       {assign var='linkParameters' value=''}
                        {if $trophyID}{capture append=linkParameters}&trophyID={@$trophyID|rawurlencode}{/capture}{/if}
                        {if $username}{capture append=linkParameters}&username={@$username|rawurlencode}{/capture}{/if}
                        
-               {pages print=true assign=pagesLinks controller='UserTrophyList' link="pageNo=%d&sortField=$sortField&sortOrder=$sortOrder$linkParameters"}
+                       {pages print=true assign=pagesLinks controller='UserTrophyList' link="pageNo=%d&sortField=$sortField&sortOrder=$sortOrder$linkParameters"}
                {/content}
        </div>
 {/hascontent}