Merge branch 'MDL-61960-master' of git://github.com/farhan6318/moodle
[moodle.git] / lib / templates / initials_bar.mustache
blob2fe1331b5ce7b891bb60c7643012b05ccc78d9da
1 {{!
2     This file is part of Moodle - http://moodle.org/
4     Moodle is free software: you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation, either version 3 of the License, or
7     (at your option) any later version.
9     Moodle is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
14     You should have received a copy of the GNU General Public License
15     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
17 {{!
18     @template core/initials_bar
20     Initials bar.
22     Example context (json):
23     {
24         "title": "First name",
25         "class": "firstinitial",
26         "current": "A",
27         "url": "http://moodle.generic32/report/progress/index.php?course=2&sifirst",
28         "all": "All",
29         "group": [
30            {
31               "letter": [
32                  {
33                     "name": "A",
34                     "url": "http://moodle.generic32/report/progress/index.php?course=2&sifirst=A"
35                  },
36                  {
37                     "name": "B",
38                     "url": "http://moodle.generic32/report/progress/index.php?course=2&sifirst=B"
39                  },
40                  {
41                     "name": "C",
42                     "url": "http://moodle.generic32/report/progress/index.php?course=2&sifirst=C"
43                  },
44                  {
45                     "name": "D",
46                     "url": "http://moodle.generic32/report/progress/index.php?course=2&sifirst=D"
47                  }
49               ]
50            },
51            {
52               "letter": [
53                  {
54                     "name": "W",
55                     "url": "http://moodle.generic32/report/progress/index.php?course=2&sifirst=W",
56                     "selected": "W"
57                  },
58                  {
59                     "name": "X",
60                     "url": "http://moodle.generic32/report/progress/index.php?course=2&sifirst=X"
61                  },
62                  {
63                     "name": "Y",
64                     "url": "http://moodle.generic32/report/progress/index.php?course=2&sifirst=Y"
65                  },
66                  {
67                     "name": "Z",
68                     "url": "http://moodle.generic32/report/progress/index.php?course=2&sifirst=Z"
69                  }
71               ]
72            }
73          ]
74     }
76 <div class="initialbar {{class}}">
77     <span class="initialbarlabel">{{title}}</span>
78     {{#current}}
79         <a class="initialbarall page-item letter" href="{{url}}">{{all}}</a>
80     {{/current}}
81     {{^current}}
82         <div class="initialbarall letter page-item active">{{all}}</div>
83     {{/current}}
85     <div class="initialbargroups">
86         {{#group}}
87             <ul class="initialbargroup">
88                 {{#letter}}
89                     {{#selected}}
90                         <li><span class="letter page-item active {{name}}">{{name}}</span></li>
91                     {{/selected}}
92                     {{^selected}}
93                         <li><a class="letter page-item {{name}}" href="{{url}}">{{name}}</a></li>
94                     {{/selected}}
95                 {{/letter}}
96             </ul>
97         {{/group}}
98     </div>
99 </div>