source: extensions/plugin_lang_analysis/template/analysis.tpl @ 23488

Last change on this file since 23488 was 23488, checked in by mistic100, 11 years ago

display unused strings as useless

File size: 4.5 KB
Line 
1{footer_script}{literal}
2$('.strings tr.string td.toggler').click(function() {
3  if ($(this).hasClass('iconpla-plus-circled')) {
4    $(this).removeClass('iconpla-plus-circled').addClass('iconpla-minus-circled');
5    $(this).parent().nextUntil('tr.string').show();
6  }
7  else {
8    $(this).removeClass('iconpla-minus-circled').addClass('iconpla-plus-circled');
9    $(this).parent().nextUntil('tr.string').hide();
10  }
11});
12
13$('.strings tr.string').hover(
14  function() {
15    $(this).addClass('hover').nextUntil('tr.string').addClass('hover');
16  },
17  function() {
18    $(this).removeClass('hover').nextUntil('tr.string').removeClass('hover');
19  }
20);
21$('.strings tr.file').hover(
22  function() {
23    $(this).prevAll('tr.string:first').addClass('hover').nextUntil('tr.string').addClass('hover');
24  },
25  function() {
26    $(this).prevAll('tr.string:first').removeClass('hover').nextUntil('tr.string').removeClass('hover');
27  }
28);
29
30$('.open-all').click(function() {
31  $('.strings tr.string td.toggler').removeClass('iconpla-plus-circled').addClass('iconpla-minus-circled');
32  $('.strings tr.file').show();
33});
34$('.open-missing').click(function() {
35  $('.strings tr.string.missing td.toggler').removeClass('iconpla-plus-circled').addClass('iconpla-minus-circled');
36  $('.strings tr.file.string-missing').show();
37});
38$('.close-all').click(function() {
39  $('.strings tr.string td.toggler').removeClass('iconpla-minus-circled').addClass('iconpla-plus-circled');
40  $('.strings tr.file').hide();
41});
42
43$('.tiptip').tipTip({
44  delay: 0,
45  fadeIn: 200,
46  fadeOut: 200,
47  defaultPosition: 'right'
48});
49{/literal}{/footer_script}
50
51{html_style}
52.strings tr td:nth-last-child(-n+{math equation="2+x" x=$PLA_LANG_FILES|@count}) {ldelim}
53  text-align:center;
54}
55{/html_style}
56
57<fieldset>
58  <legend>{'Analysis results'|@translate}</legend>
59 
60  <p style="text-align:left;">
61    <a class="open-all">{'Expand all'|@translate}</a>
62    / <a class="open-missing">{'Expand missing'|@translate}</a>
63    / <a class="close-all">{'Collapse all'|@translate}</a>
64  </p>
65 
66  <table class="strings">
67  <thead>
68    <tr>
69      <th></th>
70      <th class="legend">
71        <span class="missing">{'Missing'|@translate}</span>
72        <span class="useless">{'Useless'|@translate}</span>
73      </th>
74      <th>{'Dependency'|@translate}</th>
75    {foreach from=$PLA_LANG_FILES item=lang_file}
76      <th>{$lang_file}</th>
77    {/foreach}
78      <th>common.lang</th>
79      <th>admin.lang</th>
80    </tr>
81  </thead>
82   
83  <tbody>
84  {foreach from=$PLA_STRINGS item=data key=string}
85    <!-- begin string -->
86    <tr class="string {$data.stat}">
87      <td class="toggler iconpla-plus-circled"></td>
88      <td>
89        {$string|htmlspecialchars}
90        {if isset($data.warnings)}<span class="iconpla-attention-circled tiptip" title="{'<br>'|@implode:$data.warnings}"></span>{/if}
91      </td>
92      {if $data.is_admin}<td class="text-admin">{'Admin'|@translate}</td>
93      {else}<td class="text-common">{'Common'|@translate}</td>{/if}
94    {foreach from=$PLA_LANG_FILES item=lang_file}
95      <td>{if $lang_file|in_array:$data.in_plugin}<b>{'Yes'|@translate}</b>{else}{'No'|@translate}{/if}</td>
96    {/foreach}
97      <td>{if $data.in_common}<b>{'Yes'|@translate}</b>{else}{'No'|@translate}{/if}</td>
98      <td>{if $data.in_admin}<b>{'Yes'|@translate}</b>{else}{'No'|@translate}{/if}</td>
99    </tr>
100    {foreach from=$data.files item=file_data key=file}
101      <!-- begin file -->
102      <tr class="file string-{$data.stat} {$file_data.stat}">
103        <td></td>
104        <td>{$file} <i>({', '|@implode:$file_data.lines})</i></td>
105        {if $file_data.is_admin}<td class="text-admin">{'Admin'|@translate}</td>
106        {else}<td class="text-common">{'Common'|@translate}</td>{/if}
107      {foreach from=$PLA_LANG_FILES item=lang_file}
108        <td>{if $lang_file|in_array:$file_data.lang_files}<b>{'Yes'|@translate}</b>{else}{'No'|@translate}{/if}</td>
109      {/foreach}
110        <td></td>
111        <td></td>
112      </tr>
113    {foreachelse}
114      <tr class="file string-{$data.stat} useless">
115        <td></td>
116        <td><i>{'Unused'|@translate}</i></td>
117        {'<td></td>'|str_repeat:(3+$PLA_LANG_FILES|@count)}
118      </tr>
119    {/foreach} {* <!-- end file --> *}
120  {/foreach} {* <!-- end string --> *}
121  </tbody>
122 
123  <tfoot>
124    <tr>
125      <th></th>
126      <th>{'%d strings : %d missing and %d useless.'|@translate|sprintf:$PLA_COUNTS.total:$PLA_COUNTS.missing:$PLA_COUNTS.useless}</th>
127      {'<th></th>'|str_repeat:(3+$PLA_LANG_FILES|@count)}
128    </tr>
129  </tfoot>
130  </table>
131</fieldset>
Note: See TracBrowser for help on using the repository browser.