Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use KRadioButtonGroup in the language switcher modal and on the Device settings page #12325

Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,26 @@
@submit="setLang"
>
<KGrid>
<KGridItem
v-for="(languageCol, index) in splitLanguageOptions"
:key="index"
:class="{ 'offset-col': windowIsSmall && index === 1 }"
:layout8="{ span: 4 }"
:layout12="{ span: 6 }"
>
<KRadioButton
v-for="language in languageCol"
:key="language.id"
ref="languageItem"
v-model="selectedLanguage"
:buttonValue="language.id"
:label="language.lang_name"
:title="language.english_name"
class="language-name"
/>
</KGridItem>
<KRadioButtonGroup>
<KGridItem
v-for="(languageCol, index) in splitLanguageOptions"
:key="index"
:class="{ 'offset-col': windowIsSmall && index === 1 }"
:layout8="{ span: 4 }"
:layout12="{ span: 6 }"
>
<KRadioButton
v-for="language in languageCol"
:key="language.id"
ref="languageItem"
v-model="selectedLanguage"
:buttonValue="language.id"
:label="language.lang_name"
:title="language.english_name"
class="language-name"
/>
</KGridItem>
</KRadioButtonGroup>
</KGrid>
</KModal>
</FocusTrap>
Expand Down
109 changes: 58 additions & 51 deletions kolibri/plugins/device/assets/src/views/DeviceSettingsPage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,49 +65,52 @@

<div class="fieldset">
<label class="fieldset-label">{{ $tr('landingPageLabel') }}</label>
<KRadioButton
data-test="landingPageButton"
:label="$tr('learnerAppPageChoice')"
:buttonValue="landingPageChoices.LEARN"
:currentValue="landingPage"
@input="handleLandingPageChange"
/>
<KRadioButton
data-test="signInPageButton"
:label="$tr('signInPageChoice')"
:buttonValue="landingPageChoices.SIGN_IN"
:currentValue="landingPage"
@input="handleLandingPageChange"
/>
<div
class="fieldset"
style="margin-left: 32px"
>
<KRadioButton
data-test="allowGuestAccessButton"
:label="$tr('allowGuestAccess')"
:buttonValue="SignInPageOptions.ALLOW_GUEST_ACCESS"
:currentValue="signInPageOption"
:disabled="disableSignInPageOptions"
@input="handleSignInPageChange"
/>
<KRadioButtonGroup>
<KRadioButton
data-test="disallowGuestAccessButton"
:label="$tr('disallowGuestAccess')"
:buttonValue="SignInPageOptions.DISALLOW_GUEST_ACCESS"
:currentValue="signInPageOption"
:disabled="disableSignInPageOptions"
@input="handleSignInPageChange"
data-test="landingPageButton"
:label="$tr('learnerAppPageChoice')"
:buttonValue="landingPageChoices.LEARN"
:currentValue="landingPage"
@input="handleLandingPageChange"
/>
<KRadioButton
data-test="lockedContentButton"
:label="$tr('lockedContent')"
:buttonValue="SignInPageOptions.LOCKED_CONTENT"
:currentValue="signInPageOption"
:disabled="disableSignInPageOptions"
@input="handleSignInPageChange"
data-test="signInPageButton"
:label="$tr('signInPageChoice')"
:buttonValue="landingPageChoices.SIGN_IN"
:currentValue="landingPage"
@input="handleLandingPageChange"
/>
</div>

<div
class="fieldset"
style="margin-left: 32px"
>
<KRadioButton
data-test="allowGuestAccessButton"
:label="$tr('allowGuestAccess')"
:buttonValue="SignInPageOptions.ALLOW_GUEST_ACCESS"
:currentValue="signInPageOption"
:disabled="disableSignInPageOptions"
@input="handleSignInPageChange"
/>
<KRadioButton
data-test="disallowGuestAccessButton"
:label="$tr('disallowGuestAccess')"
:buttonValue="SignInPageOptions.DISALLOW_GUEST_ACCESS"
:currentValue="signInPageOption"
:disabled="disableSignInPageOptions"
@input="handleSignInPageChange"
/>
<KRadioButton
data-test="lockedContentButton"
:label="$tr('lockedContent')"
:buttonValue="SignInPageOptions.LOCKED_CONTENT"
:currentValue="signInPageOption"
:disabled="disableSignInPageOptions"
@input="handleSignInPageChange"
/>
</div>
</KRadioButtonGroup>
</div>

<div
Expand All @@ -120,18 +123,22 @@
<p :class="InfoDescriptionColor">
{{ $tr('DownloadOnMeteredConnectionDescription') }}
</p>
<KRadioButton
:label="$tr('doNotAllowDownload')"
:buttonValue="meteredConnectionDownloadOptions.DISALLOW_DOWNLOAD_ON_METERED_CONNECTION"
:currentValue="meteredConnectionDownloadOption"
@input="handleMeteredConnectionDownloadChange"
/>
<KRadioButton
:label="$tr('allowDownload')"
:buttonValue="meteredConnectionDownloadOptions.ALLOW_DOWNLOAD_ON_METERED_CONNECTION"
:currentValue="meteredConnectionDownloadOption"
@input="handleMeteredConnectionDownloadChange"
/>
<KRadioButtonGroup>
<KRadioButton
:label="$tr('doNotAllowDownload')"
:buttonValue="
meteredConnectionDownloadOptions.DISALLOW_DOWNLOAD_ON_METERED_CONNECTION
"
:currentValue="meteredConnectionDownloadOption"
@input="handleMeteredConnectionDownloadChange"
/>
<KRadioButton
:label="$tr('allowDownload')"
:buttonValue="meteredConnectionDownloadOptions.ALLOW_DOWNLOAD_ON_METERED_CONNECTION"
:currentValue="meteredConnectionDownloadOption"
@input="handleMeteredConnectionDownloadChange"
/>
</KRadioButtonGroup>
</div>

<div>
Expand Down
Loading