|
68 | 68 | 'align' => 'left', |
69 | 69 | ] |
70 | 70 | ), |
| 71 | + new OOUI\FieldLayout( |
| 72 | + new OOUI\MultilineTextInputWidget( [ |
| 73 | + 'name' => 'siteConfig', |
| 74 | + 'placeholder' => "{\n \"Sitename\": \"Test wiki\"\n}", |
| 75 | + 'rows' => 4, |
| 76 | + ] ), |
| 77 | + [ |
| 78 | + 'label' => 'Site config:', |
| 79 | + 'help' => new OOUI\HtmlSnippet( 'All keys will be given a <strong><code>$wg</code></strong> prefix.<br/>This file will be <strong>public</strong>.' ), |
| 80 | + 'helpInline' => true, |
| 81 | + 'align' => 'left', |
| 82 | + ] |
| 83 | + ), |
71 | 84 | new DetailsFieldLayout( |
72 | 85 | new OOUI\CheckboxMultiselectInputWidget( [ |
73 | 86 | 'name' => 'repos[]', |
74 | 87 | 'options' => $repoOptions, |
75 | 88 | 'value' => array_keys( $repoData ), |
76 | 89 | ] ), |
77 | 90 | [ |
78 | | - 'label' => 'Choose extensions to enable (default: all):', |
| 91 | + 'label' => 'Choose extensions to enable:', |
| 92 | + 'help' => new OOUI\HtmlSnippet( '<br/>Defaults to all' ), |
| 93 | + 'helpInline' => true, |
79 | 94 | 'align' => 'left', |
80 | 95 | ] |
81 | 96 | ), |
|
157 | 172 | } |
158 | 173 | $creator = get_creator( $dir ); |
159 | 174 | $created = get_created( $dir ); |
| 175 | + $siteConfig = get_if_file_exists( 'wikis/' . $dir . '/w/config.json' ); |
| 176 | + $hasConfig = $siteConfig && strlen( trim( $siteConfig ) ); |
160 | 177 |
|
161 | 178 | if ( !$created ) { |
162 | 179 | // Add created.txt to old wikis |
|
169 | 186 | $wikis[ $dir ] = [ |
170 | 187 | 'mtime' => $created, |
171 | 188 | 'title' => $title, |
172 | | - 'creator' => $creator |
| 189 | + 'creator' => $creator, |
| 190 | + 'hasConfig' => $hasConfig, |
173 | 191 | ]; |
174 | 192 | } |
175 | 193 | } |
|
190 | 208 | $anyCanDelete = $anyCanDelete || $canDelete; |
191 | 209 | $rows .= '<tr' . ( $creator !== $username ? ' class="other"' : '' ) . '>' . |
192 | 210 | '<td class="title">' . ( $title ?: '<em>No patches</em>' ) . '</td>' . |
193 | | - '<td><a href="wikis/' . $wiki . '/w">' . $wiki . '</a></td>' . |
| 211 | + '<td>' . |
| 212 | + ( !empty( $data[ 'hasConfig' ] ) ? |
| 213 | + '<a href="wikis/' . $wiki . '/w/config.json">JSON</a>' : |
| 214 | + '' |
| 215 | + ) . |
| 216 | + '</td>' . |
| 217 | + '<td><a href="wikis/' . $wiki . '/w">' . substr( $wiki, 0, 20 ) . '…</a></td>' . |
194 | 218 | '<td class="date">' . date( 'c', $data[ 'mtime' ] ) . '</td>' . |
195 | 219 | ( $useOAuth ? '<td>' . ( $creator ? user_link( $creator ) : '?' ) . '</td>' : '' ) . |
196 | 220 | ( $canDelete ? |
|
202 | 226 |
|
203 | 227 | echo '<tr>' . |
204 | 228 | '<th>Patches</th>' . |
| 229 | + '<th>Config</th>' . |
205 | 230 | '<th>Link</th>' . |
206 | 231 | '<th>Time</th>' . |
207 | 232 | ( $useOAuth ? '<th>Creator</th>' : '' ) . |
|
0 commit comments