Skip to content

Commit f5dc655

Browse files
committed
Added logic to display custom nested folders in wizard
1 parent e0b01ec commit f5dc655

File tree

5 files changed

+33
-11
lines changed

5 files changed

+33
-11
lines changed

app/wizard/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ $(document).on('click', '[data-access-tokens-details]', (event) => {
285285
const showNotices = (element) => {
286286
const target = $(element);
287287

288-
const selection = target.val();
288+
const selection = target.val().replace(/\//g, '-');
289289
const column = target.closest('.columns').find('.column:last');
290290

291291
column.find('[class*="description-"]').addClass('hidden');

css-compiled/git-sync.css

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scss/plugin/_wizard.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
flex: 1;
8888

8989
&:first-child {
90-
width: 25%;
90+
width: 35%;
9191
flex: none;
9292
border-right: 1px solid #ddd;
9393
margin-right: 2rem;
@@ -145,6 +145,10 @@
145145
margin-right: .5rem;
146146
font-size: 1.2rem;
147147
}
148+
149+
hr {
150+
margin: .5rem 0;
151+
}
148152
}
149153
}
150154

templates/partials/modal-wizard.html.twig

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
</div>
1919

2020
<div class="step-1">
21-
{% set selectedRepo = 'allothers' in settings.repository ? 'allothers' : selectedRepo %}
2221
{% set selectedRepo = 'github.com' in settings.repository ? 'github' : selectedRepo %}
2322
{% set selectedRepo = 'bitbucket.com' in settings.repository ? 'bitbucket' : selectedRepo %}
2423
{% set selectedRepo = 'gitlab.com' in settings.repository ? 'gitlab' : selectedRepo %}
24+
{% set selectedRepo = not (settings.repository is empty) and not selectedRepo ? 'allothers' : selectedRepo %}
2525

2626
<h1>Step 1 - Hosting Service</h1>
2727
<div class="panel hidden disabled">
@@ -314,39 +314,48 @@
314314
<div class="column">
315315
<label>
316316
<input type="checkbox" value="pages" name="gitsync[folders]" {{ not settings.folders or 'pages' in settings.folders ? 'checked' : '' }} />
317-
Pages
317+
<span>Pages</span>
318318
<i class="info-desc fa fa-info-circle"></i>
319319
</label>
320320
<label>
321321
<input type="checkbox" value="themes" name="gitsync[folders]" {{ 'themes' in settings.folders ? 'checked' : '' }} />
322-
Themes
322+
<span>Themes</span>
323323
<i class="info-desc fa fa-info-circle"></i>
324324
</label>
325325
<label>
326326
<input type="checkbox" value="plugins" name="gitsync[folders]" {{ 'plugins' in settings.folders ? 'checked' : '' }} />
327-
Plugins
327+
<span>Plugins</span>
328328
<i class="info-desc fa fa-info-circle"></i>
329329
</label>
330330
<label>
331331
<input type="checkbox" value="config" name="gitsync[folders]" {{ 'config' in settings.folders ? 'checked' : '' }} />
332-
Config
332+
<span>Config</span>
333333
<span class="hint--right" data-hint="This folder might contain sensitive data"><i class="fa fa-warning"></i></span>
334334
<i class="info-desc fa fa-info-circle"></i>
335335
</label>
336336
<label>
337337
<input type="checkbox" value="data" name="gitsync[folders]"{{ 'data' in settings.folders ? 'checked' : '' }} />
338-
Data
338+
<span>Data</span>
339339
<span class="hint--right" data-hint="This folder might contain sensitive data"><i class="fa fa-warning"></i></span>
340340
<i class="info-desc fa fa-info-circle"></i>
341341
</label>
342342
{% if 'accounts' in settings.folders %}
343343
<label>
344344
<input type="checkbox" value="accounts" name="gitsync[folders]" {{ 'accounts' in settings.folders ? 'checked' : '' }} />
345-
Accounts
345+
<span>Accounts</span>
346346
<span class="hint--right" data-hint="This folder contains sensitive data"><i class="fa fa-warning"></i></span>
347347
<i class="info-desc fa fa-info-circle"></i>
348348
</label>
349349
{% endif %}
350+
351+
{% for folder in settings.folders if '/' in folder %}
352+
{% if loop.index0 == 0%}<hr />{% endif %}
353+
<label>
354+
<input type="checkbox" value="{{ folder }}" name="gitsync[folders]" checked />
355+
<span>{{ folder }}</span>
356+
<i class="info-desc fa fa-info-circle"></i>
357+
</label>
358+
{% endfor %}
350359
</div>
351360
<div class="column">
352361
<div class="description">
@@ -372,6 +381,12 @@
372381
<p class="info warning description-accounts description-config description-data hidden">Careful! This folder can contain sensitive data and synchronizing it will potentially expose the data publicly. Private repository recommended.</p>
373382

374383
<p class="info alert description-themes hidden">Note that changes happening in this folder can't be detected automatically by GitSync, therefore a manual synchronization will be required.</p>
384+
385+
{% for folder in settings.folders if '/' in folder %}
386+
<p class="description-{{ folder|replace({'/': '-'}) }} hidden">
387+
This folders was manually added either by you in the settings or by your Skeleton.
388+
</p>
389+
{% endfor %}
375390
</div>
376391
</div>
377392
</div>

0 commit comments

Comments
 (0)