<template name="accountPreferences">
	<section class="preferences-page preferences-page--new page-container page-home page-static">
		{{#header sectionName="Preferences" buttons=true fullpage=true}}
		<div class="rc-header__section-button">
			<button class="rc-button rc-button--primary save"><span>{{_ "Save_changes"}}</span></button>
		</div>
		{{/header}}

		<div class="content">
			<form id="preferences" autocomplete="off">
				<fieldset class="rc-form-legend">
					<div class="section">
						<h1>{{_ "Localization"}}</h1>
						<div class="section-content border-component-color">
							<div class="input-line double-col">
								<label for="language">{{_ "Language"}}</label>
								<div class="rc-select">
									<select id="language" class="required rc-select__element">
										{{#each languages}}
											<option value="{{key}}" selected="{{isUserLanguage key}}" dir="auto">{{name}}</option>
										{{/each}}
									</select>
									{{> icon block="rc-select__arrow" icon="arrow-down"}}
								</div>
							</div>
						</div>
					</div>
					<div class="section">
						<h1>{{_ "Global"}}</h1>
						<div class="section-content border-component-color">
							<div class="input-line double-col">
								<label for="language">{{_ "Dont_ask_me_again_list"}}</label>
								<div class="rc-select">
									<select id="dont-ask" class="rc-select__element" multiple>
										{{#each dontAskAgainList}}
											<option value="{{action}}">{{label}}</option>
										{{/each}}
									</select>
								</div>
								<button class="rc-button rc-button--cancel js-dont-ask-remove"><span>{{_ "Remove"}}</span></button>
							</div>
						</div>
					</div>
					<div class="section">
						<h1>{{_ "User_Presence"}}</h1>
						<div class="section-content border-component-color">
							<div class="input-line double-col" id="enableAutoAway">
								<label>{{_ "Enable_Auto_Away"}}</label>
								<div>
									<label><input type="radio" name="enableAutoAway" value="true" checked="{{ checked 'enableAutoAway' true }}"/> {{_ "True"}}</label>
									<label><input type="radio" name="enableAutoAway" value="false" checked="{{ checked 'enableAutoAway' false }}"/> {{_ "False"}}</label>
								</div>
							</div>

							<div class="input-line double-col" id="idleTimeLimit">
								<label>{{_ "Idle_Time_Limit"}}</label>
								<div>
									{{#if idleTimeLimit}}
										<input type="number" class="rc-input__element" name="idleTimeLimit" min="0" value="{{idleTimeLimit}}">
									{{else}}
										<input type="number" class="rc-input__element" name="idleTimeLimit" min="0" value="" placeholder="{{_ "Use_Global_Settings"}} ({{defaultIdleTimeLimit}})">
									{{/if}}
									<div class="info">{{_ "Idle_Time_Limit_Description"}}</div>
								</div>
							</div>
						</div>

					</div>
					<div class="section">
						<h1>{{_ "Notifications"}}</h1>
						<div class="section-content border-component-color">
							<div class="input-line double-col">
								<label>{{_ "Desktop_Notifications"}}</label>
								<div>
									{{#if desktopNotificationEnabled}}
										<label>{{_ "Desktop_Notifications_Enabled"}}</label>
										<label><button class="button test-notifications"><i class="icon-comment-empty secondary-font-color"></i> <span>{{_ "Test_Desktop_Notifications"}}</span></button></label>
									{{else}}
										{{#if desktopNotificationDisabled}}
											<label>{{_ "Desktop_Notifications_Disabled"}}</label>
										{{else}}
											<label><button class="button enable-notifications"><i class="icon-comment-empty secondary-font-color"></i> <span>{{_ "Enable_Desktop_Notifications"}}</span></button></label>
										{{/if}}
									{{/if}}
								</div>
							</div>
							<div class="input-line double-col">
								<label>{{_ "Notification_Duration"}}</label>
								<div>
									{{#if desktopNotificationDuration}}
										<input type="number" class="rc-input__element" name="desktopNotificationDuration" min="0" value="{{desktopNotificationDuration}}">
									{{else}}
										<input type="number" class="rc-input__element" name="desktopNotificationDuration" min="0" value="" placeholder="{{_ "Use_Global_Settings"}} ({{defaultDesktopNotificationDuration}})">
									{{/if}}
								</div>
							</div>
							<div class="input-line double-col" id="desktopNotifications">
								<label>{{_ "Notification_Desktop_Default_For"}}</label>
								<div class="rc-select">
									<select class="input-monitor rc-select__element" name="desktopNotifications">
										<option value="default" selected="{{selected 'desktopNotifications' 'default' 'default'}}">{{_ "Default"}} ({{_ defaultDesktopNotification}})</option>
										<option value="all" selected="{{selected 'desktopNotifications' 'all' 'default'}}">{{_ "All_messages"}}</option>
										<option value="mentions" selected="{{selected 'desktopNotifications' 'mentions' 'default'}}">{{_ "Mentions"}}</option>
										<option value="nothing" selected="{{selected 'desktopNotifications' 'nothing' 'default'}}">{{_ "Nothing"}}</option>
									</select>
									{{> icon block="rc-select__arrow" icon="arrow-down" }}
								</div>
							</div>
							<div class="input-line double-col" id="mobileNotifications">
								<label>{{_ "Notification_Mobile_Default_For"}}</label>
								<div class="rc-select">
									<select class="input-monitor rc-select__element" name="mobileNotifications">
										<option value="default" selected="{{selected 'mobileNotifications' 'default' 'default'}}">{{_ "Default"}} ({{_ defaultMobileNotification}})</option>
										<option value="all" selected="{{selected 'mobileNotifications' 'all' 'default'}}">{{_ "All_messages"}}</option>
										<option value="mentions" selected="{{selected 'mobileNotifications' 'mentions' 'default'}}">{{_ "Mentions"}}</option>
										<option value="nothing" selected="{{selected 'mobileNotifications' 'nothing' 'default'}}">{{_ "Nothing"}}</option>
									</select>
									{{> icon block="rc-select__arrow" icon="arrow-down" }}
								</div>
							</div>
							<div class="input-line double-col" id="emailNotificationMode">
								<label>{{_ "Email_Notification_Mode"}}</label>
								<div>
									<div class="rc-select">
										<select class="input-monitor rc-select__element" name="emailNotificationMode">
											<option value="default" selected="{{selected 'emailNotificationMode' 'default' 'default'}}">{{_ "Default"}} ({{_ defaultEmailNotification}})</option>
											<option value="nothing" selected="{{selected 'emailNotificationMode' 'nothing'}}">{{_ "Email_Notification_Mode_Disabled"}}</option>
											<option value="mentions" selected="{{selected 'emailNotificationMode' 'mentions'}}">{{_ "Email_Notification_Mode_All"}}</option>
										</select>
										{{> icon block="rc-select__arrow" icon="arrow-down" }}
									</div>
									<div class="info">{{_ "You_need_to_verifiy_your_email_address_to_get_notications"}}</div>
								</div>
							</div>
						</div>
					</div>
					<div class="section">
						<h1>{{_ "Messages"}}</h1>
						<div class="section-content border-component-color">
							<div class="input-line double-col" id="unreadAlert">
								<label>{{_ "Unread_Tray_Icon_Alert"}}</label>
								<div>
									<label><input type="radio" name="unreadAlert" value="true" checked="{{checked 'unreadAlert' true}}"/> {{_ "On"}}</label>
									<label><input type="radio" name="unreadAlert" value="false" checked="{{checked 'unreadAlert' false}}"/> {{_ "Off"}}</label>
								</div>
							</div>
							<div class="input-line double-col">
								<label>{{_ "Use_Emojis"}}</label>
								<div>
									<label><input type="radio" name="useEmojis" value="true" checked="{{checked 'useEmojis' true}}" /> {{_ "True"}}</label>
									<label><input type="radio" name="useEmojis" value="false" checked="{{checked 'useEmojis' false}}" /> {{_ "False"}}</label>
								</div>
							</div>
							<div class="input-line double-col" id="convertAsciiEmoji">
								<label>{{_ "Convert_Ascii_Emojis"}}</label>
								<div>
									<label><input type="radio" name="convertAsciiEmoji" value="true" checked="{{checked 'convertAsciiEmoji' true}}" /> {{_ "True"}}</label>
									<label><input type="radio" name="convertAsciiEmoji" value="false" checked="{{checked 'convertAsciiEmoji' false}}" /> {{_ "False"}}</label>
								</div>
							</div>
							<div class="input-line double-col" id="autoImageLoad">
								<label>{{_ "Auto_Load_Images"}}</label>
								<div>
									<label><input type="radio" name="autoImageLoad" value="true" checked="{{checked 'autoImageLoad' true}}" /> {{_ "True"}}</label>
									<label><input type="radio" name="autoImageLoad" value="false" checked="{{checked 'autoImageLoad' false}}" /> {{_ "False"}}</label>
								</div>
							</div>
							<div class="input-line double-col" id="saveMobileBandwidth">
								<label>{{_ "Save_Mobile_Bandwidth"}}</label>
								<div>
									<label><input type="radio" name="saveMobileBandwidth" value="true" checked="{{checked 'saveMobileBandwidth' true}}" /> {{_ "True"}}</label>
									<label><input type="radio" name="saveMobileBandwidth" value="false" checked="{{checked 'saveMobileBandwidth' false}}" /> {{_ "False"}}</label>
								</div>
							</div>
							<div class="input-line double-col" id="collapseMediaByDefault">
								<label>{{_ "Collapse_Embedded_Media_By_Default"}}</label>
								<div>
									<label><input type="radio" name="collapseMediaByDefault" value="true" checked="{{checked 'collapseMediaByDefault' true}}" /> {{_ "True"}}</label>
									<label><input type="radio" name="collapseMediaByDefault" value="false" checked="{{checked 'collapseMediaByDefault' false}}" /> {{_ "False"}}</label>
								</div>
							</div>
							<div class="input-line double-col" id="hideUsernames">
								<label>{{_ "Hide_usernames"}}</label>
								<div>
									<label><input type="radio" name="hideUsernames" value="true" checked="{{checked 'hideUsernames' true}}" /> {{_ "True"}}</label>
									<label><input type="radio" name="hideUsernames" value="false" checked="{{checked 'hideUsernames' false}}" /> {{_ "False"}}</label>
								</div>
							</div>
							{{#if showRoles}}
								<div class="input-line double-col" id="hideRoles">
									<label>{{_ "Hide_roles"}}</label>
									<div>
										<label><input type="radio" name="hideRoles" value="true" checked="{{checked 'hideRoles' true}}" /> {{_ "True"}}</label>
										<label><input type="radio" name="hideRoles" value="false" checked="{{checked 'hideRoles' false}}" /> {{_ "False"}}</label>
									</div>
								</div>
							{{/if}}
							<div class="input-line double-col" id="hideFlexTab">
								<label>{{_ "Hide_flextab"}}</label>
								<div>
									<label><input type="radio" name="hideFlexTab" value="true" checked="{{checked 'hideFlexTab' true}}" /> {{_ "True"}}</label>
									<label><input type="radio" name="hideFlexTab" value="false" checked="{{checked 'hideFlexTab' false}}" /> {{_ "False"}}</label>
								</div>
							</div>
							<div class="input-line double-col" id="hideAvatars">
								<label>{{_ "Hide_Avatars"}}</label>
								<div>
									<label><input type="radio" name="hideAvatars" value="true" checked="{{checked 'hideAvatars' true}}"/> {{_ "True"}}</label>
									<label><input type="radio" name="hideAvatars" value="false" checked="{{checked 'hideAvatars' false}}"/> {{_ "False"}}</label>
								</div>
							</div>
							<div class="input-line double-col" id="messageViewMode">
								<label>{{_ "View_mode"}}</label>
								<div>
									<div class="rc-select">
										<select class="input-monitor rc-select__element" name="messageViewMode">
											<option value="0" selected="{{selected 'messageViewMode' 0}}">{{_ "Normal"}}</option>
											<option value="1" selected="{{selected 'messageViewMode' 1}}">{{_ "Cozy"}}</option>
											<option value="2" selected="{{selected 'messageViewMode' 2}}">{{_ "Compact"}}</option>
										</select>
										{{> icon block="rc-select__arrow" icon="arrow-down" }}
									</div>
									<div class="info">{{_ "Message_view_mode_info"}}</div>
								</div>
							</div>
							<div class="input-line double-col" id="sendOnEnter">
								<label>{{_ "Enter_Behaviour"}}</label>
								<div>
									<div class="rc-select">
										<select class="input-monitor rc-select__element" name="sendOnEnter">
											<option value="normal" selected="{{selected 'sendOnEnter' 'normal'}}">{{_ "Enter_Normal"}}</option>
											<option value="alternative" selected="{{selected 'sendOnEnter' 'alternative'}}">{{_ "Enter_Alternative"}}</option>
											<option value="desktop" selected="{{selected 'sendOnEnter' 'desktop'}}">{{_ "Only_On_Desktop"}}</option>
										</select>
										{{> icon block="rc-select__arrow" icon="arrow-down" }}
									</div>
									<div class="info">{{_ "Enter_Behaviour_Description"}}</div>
								</div>
							</div>
						</div>
					</div>
					<div class="section">
						<h1>{{_ "Sidebar"}}</h1>
						<div class="section-content border-component-color">
							<div class="input-line double-col" id="roomCounterSidebar">
								<label>{{_ "Show_room_counter_on_sidebar"}}</label>
								<div>
									<label><input type="radio" name="roomCounterSidebar" value="true" checked="{{checked 'roomCounterSidebar' true}}"/> {{_ "True"}}</label>
									<label><input type="radio" name="roomCounterSidebar" value="false" checked="{{checked 'roomCounterSidebar' false}}"/> {{_ "False"}}</label>
								</div>
							</div>
						</div>
					</div>
					<div class="section">
						<h1>{{_ "Highlights"}}</h1>
						<div class="section-content border-component-color">
							<div class="input-line double-col">
								<label>{{_ "Highlights_List"}}</label>
								<div>
									<label>{{_ "Highlights_How_To"}}</label>
									<textarea class="rc-input__element" name="highlights" id="highlights" cols="30" rows="10">{{highlights}}</textarea>
								</div>
							</div>
						</div>
					</div>
					<div class="section">
						<h1>{{_ "Sound"}}</h1>
						<div class="section-content border-component-color">
							<div class="input-line double-col">
								<label>{{_ "New_Room_Notification"}}</label>
								<div class="rc-select">
									<select name="newRoomNotification" class="audio rc-select__element">
										<option value="none" selected="{{$eq newRoomNotification 'none'}}">{{_ "None"}}</option>
										<option value="door" selected="{{$eq newRoomNotification 'door'}}">Door ({{_ "Default"}})</option>
										{{#each audioAssets}}
											<option value="{{_id}}" selected="{{$eq newRoomNotification _id}}">{{name}}</option>
										{{/each}}
									</select>
									{{> icon block="rc-select__arrow" icon="arrow-down" }}
								</div>
							</div>
							<div class="input-line double-col">
								<label>{{_ "New_Message_Notification"}}</label>
								<div class="rc-select">
									<select name="newMessageNotification" class="audio rc-select__element">
										<option value="none" selected="{{$eq newMessageNotification 'none'}}">{{_ "None"}}</option>
										<option value="chime" selected="{{$eq newMessageNotification 'chime'}}">Chime ({{_ "Default"}})</option>
										{{#each audioAssets}}
											<option value="{{_id}}" selected="{{$eq newMessageNotification _id}}">{{name}}</option>
										{{/each}}
									</select>
									{{> icon block="rc-select__arrow" icon="arrow-down" }}
								</div>
							</div>
							<div class="input-line double-col" id="muteFocusedConversations">
								<label>{{_ "Mute_Focused_Conversations"}}</label>
								<div>
									<label><input type="radio" name="muteFocusedConversations" value="true" checked="{{checked 'muteFocusedConversations' true}}"/> {{_ "True"}}</label>
									<label><input type="radio" name="muteFocusedConversations" value="false" checked="{{checked 'muteFocusedConversations' false}}"/> {{_ "False"}}</label>
								</div>
							</div>
							<div class="input-line double-col">
								<label>{{_ "Notifications_Sound_Volume"}}</label>
								<div>
									{{> slider id="notificationsSoundVolume" min="0" max="100" value=notificationsSoundVolume}}
								</div>
							</div>
						</div>
					</div>

					{{#if userDataDownloadEnabled}}
						<div class="section">
							<h1>{{_ "My Data"}}</h1>
							<div class="section-content border-component-color">
								<div class="input-line">
									<label><button class="button download-my-data"><i class="icon-download secondary-font-color"></i> <span>{{_ "Download_My_Data"}}</span></button></label>
									<label><button class="button export-my-data"><i class="icon-download secondary-font-color"></i> <span>{{_ "Export_My_Data"}}</span></button></label>
								</div>

							</div>
						</div>
					{{/if}}
				</fieldset>
			</form>
		</div>
	</section>
</template>
