<commit_before><template>
	<div id="accessibility" class="section">
		<h2>{{t('accessibility', 'Accessibility')}}</h2>
		<p>
			{{t('accessibility', 'Universal access is very important to us. We follow web standards and check to make everything usable also without mouse, and assistive software such as screenreaders.')}} We aim to be compliant with the <a target="_blank" href="https://www.w3.org/WAI/standards-guidelines/wcag/" rel="noreferrer nofollow">Web Content Accessibility Guidelines</a>  2.1 on AA level, with the high contrast theme even on AAA level.</br>
			If you find any issues, don’t hesitate to report them on <a target="_blank" href="https://github.com/nextcloud/server/issues/" rel="noreferrer nofollow">our issue tracker</a>. And if you want to get involved, come join <a target="_blank" href="https://nextcloud.com/design" rel="noreferrer nofollow">our design team</a>!
		</p>

		<div class="preview-list">
			<preview v-for="preview in themes" :preview="preview"
				 :key="preview.id" :selected="selected.theme"
				 v-on:select="selectTheme"></preview>
			<preview v-for="preview in fonts" :preview="preview"
				 :key="preview.id" :selected="selected.font"
				 v-on:select="selectFont"></preview>
		</div>
	</div>
</template>

<script>
import preview from './components/itemPreview';
import axios from 'nextcloud-axios';

export default {
	name: 'Accessibility',
	components: { preview },
	beforeMount() {
		// importing server data into the app
		const serverDataElmt = document.getElementById('serverData');
		if (serverDataElmt !== null) {
			this.serverData = JSON.parse(
				document.getElementById('serverData').dataset.server
			);
		}
	},
	data() {
		return {
			serverData: []
		};
	},
	computed: {
		themes() {
			return this.serverData.themes;
		},
		fonts() {
			return this.serverData.fonts;
		},
		selected() {
			return {
				theme: this.serverData.theme,
				font: this.serverData.font
			};
		}
	},
	methods: {
		selectTheme(id) {
			this.selectItem('theme', id);
		},
		selectFont(id) {
			this.selectItem('font', id);
		},

		/**
		 * Commit a change and force reload css
		 * Fetching the file again will trigger the server update
		 *
		 * @param {string} type type of the change (font or theme)
		 * @param {string} id the data of the change
		 */
		selectItem(type, id) {
			axios.post(
					OC.linkToOCS('apps/accessibility/api/v1/config', 2) + type,
					{ value: id }<commit_msg>Convert to Raw HTML approach, first try<commit_after><template>
	<div id="accessibility" class="section">
		<h2>{{t('accessibility', 'Accessibility')}}</h2>
		<p v-html="description" />
		<p v-html="descriptionDetail" />

		<div class="preview-list">
			<preview v-for="preview in themes" :preview="preview"
				 :key="preview.id" :selected="selected.theme"
				 v-on:select="selectTheme"></preview>
			<preview v-for="preview in fonts" :preview="preview"
				 :key="preview.id" :selected="selected.font"
				 v-on:select="selectFont"></preview>
		</div>
	</div>
</template>

<script>
import preview from './components/itemPreview';
import axios from 'nextcloud-axios';

export default {
	name: 'Accessibility',
	components: { preview },
	beforeMount() {
		// importing server data into the app
		const serverDataElmt = document.getElementById('serverData');
		if (serverDataElmt !== null) {
			this.serverData = JSON.parse(
				document.getElementById('serverData').dataset.server
			);
		}
	},
	data() {
		return {
			serverData: []
		};
	},
	computed: {
		themes() {
			return this.serverData.themes;
		},
		fonts() {
			return this.serverData.fonts;
		},
		selected() {
			return {
				theme: this.serverData.theme,
				font: this.serverData.font
			};
		},
		description() {
			return t('accessibility', 'Universal access is very important to us. We follow web standards and check to make everything usable also without mouse, and assistive software such as screenreaders. We aim to be compliant with the {guidelines} 2.1 on AA level, with the high contrast theme even on AAA level.', {guidelines: this.guidelinesLink})
		},
		guidelinesLink() {
			return `<a target="_blank" href="https://www.w3.org/WAI/standards-guidelines/wcag/" rel="noreferrer nofollow">${t('accessibility', 'Web Content Accessibility Guidelines')}</a>`
		},
		descriptionDetail() {
			return t('accessibility', 'If you find any issues, don’t hesitate to report them on {issuetracker}. And if you want to get involved, come join {designteam}!', {issuetracker: this.issuetrackerLink, designteam: this.designteamLink})
		},
		issuetrackerLink() {
			return `<a target="_blank" href="https://github.com/nextcloud/server/issues/" rel="noreferrer nofollow">${t('accessibility', 'our issue tracker')}</a>`
		},
		designteamLink() {
			return `<a target="_blank" href="https://nextcloud.com/design" rel="noreferrer nofollow">${t('accessibility', 'our design team')}</a>`
		}
	},
	methods: {
		selectTheme(id) {
			this.selectItem('theme', id);
		},
		selectFont(id) {
			this.selectItem('font', id);
		},

		/**
		 * Commit a change and force reload css
		 * Fetching the file again will trigger the server update
		 *
		 * @param {string} type type of the change (font or theme)
		 * @param {string} id the data of the change
		 */
		selectItem(type, id) {
			axios.post(
					OC.linkToOCS('apps/accessibility/api/v1/config', 2) + type,
					{ value: id }
{'fraction_non_alphanumeric': 0.1511758118701008, 'fraction_numerical': 0.0026129152668906306, 'mean_word_length': 4.022492970946579, 'pattern_counts': {'":': 0, '<': 46, '<?xml version=': 0, '>': 46, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2110179', 'n_tokens_mistral': 1918, 'n_tokens_neox': 1663, 'n_words': 459}