@@ -0,0 +1,185 @@
2+ * Copyright (C) 2015 Canonical, Ltd.
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
18+import Ubuntu.Components 1.2
19+import ".." as LocalComponents
21+LocalComponents.Page {
22+ objectName: "ubuntuAccountSignUpPage"
24+ title: i18n.tr("Create Account")
26+ backButtonText: i18n.tr("Cancel")
27+ forwardButtonSourceComponent: forwardButton
31+ anchors.fill: content
36+ anchors.left: parent.left
37+ anchors.right: parent.right
39+ text: i18n.tr("Email:")
41+ font.weight: Font.Light
46+ anchors.left: parent.left
47+ anchors.right: parent.right
48+ anchors.top: emailLabel.bottom
49+ anchors.topMargin: units.gu(1)
50+ inputMethodHints: Qt.ImhEmailCharactersOnly
51+ validator: RegExpValidator {
52+ regExp: /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i
54+ KeyNavigation.tab: nameInput
60+ anchors.left: parent.left
61+ anchors.right: parent.right
62+ anchors.top: emailInput.bottom
63+ anchors.topMargin: units.gu(3)
65+ text: i18n.tr("Your name:")
67+ font.weight: Font.Light
72+ anchors.left: parent.left
73+ anchors.right: parent.right
74+ anchors.top: nameLabel.bottom
75+ anchors.topMargin: units.gu(1)
76+ KeyNavigation.tab: passInput
82+ anchors.left: parent.left
83+ anchors.right: parent.right
84+ anchors.top: nameInput.bottom
85+ anchors.topMargin: units.gu(3)
87+ text: i18n.tr("Password:")
89+ font.weight: Font.Light
94+ anchors.left: parent.left
95+ anchors.right: parent.right
96+ anchors.top: passLabel.bottom
97+ anchors.topMargin: units.gu(1)
98+ echoMode: TextInput.Password
99+ KeyNavigation.tab: pass2Input
103+ LocalComponents.PasswordMeter {
105+ anchors.left: parent.left
106+ anchors.right: parent.right
107+ anchors.top: passInput.bottom
108+ anchors.topMargin: units.gu(1)
109+ password: passInput.text
115+ anchors.left: parent.left
116+ anchors.right: parent.right
117+ anchors.top: passMeter.bottom
118+ anchors.topMargin: passInput.text !== "" ? units.gu(6) : units.gu(3)
120+ text: i18n.tr("Repeat password:")
122+ font.weight: Font.Light
127+ anchors.left: parent.left
128+ anchors.right: parent.right
129+ anchors.top: pass2Label.bottom
130+ anchors.topMargin: units.gu(1)
131+ echoMode: TextInput.Password
132+ KeyNavigation.tab: encryptCheck
135+ LocalComponents.CheckableSetting {
137+ objectName: "encryptCheck"
139+ anchors.left: parent.left
140+ anchors.right: parent.right
141+ anchors.top: pass2Input.bottom
142+ anchors.topMargin: units.gu(3)
143+ text: i18n.tr("Encrypt my content")
144+ KeyNavigation.tab: optoutCheck
147+ LocalComponents.CheckableSetting {
149+ objectName: "optoutCheck"
151+ anchors.left: parent.left
152+ anchors.right: parent.right
153+ anchors.top: encryptCheck.bottom
154+ anchors.topMargin: units.gu(3)
155+ text: i18n.tr("Opt out of cloud account (not recommended)")
156+ KeyNavigation.tab: termsCheck
157+ visible: false // TODO re-enable in Phase 2
160+ LocalComponents.CheckableSetting {
162+ objectName: "termsCheck"
164+ anchors.left: parent.left
165+ anchors.right: parent.right
166+ anchors.top: optoutCheck.bottom
167+ anchors.topMargin: units.gu(1)
168+ text: i18n.tr("I have read and accept the Ubuntu account <a href='#'>terms of service</a>")
169+ //onLinkActivated: pageStack.load(Qt.resolvedUrl("here-terms.qml")) // TODO show terms
170+ KeyNavigation.tab: emailInput
171+ visible: false // TODO re-enable in Phase 2
177+ LocalComponents.StackButton {
178+ enabled: emailInput.acceptableInput && nameInput.text !== "" &&
179+ //termsCheck.checked && // TODO re-enable in Phase 2
180+ pass2Input.text.length > 5 && passInput.text === pass2Input.text
181+ text: i18n.tr("Sign Up")
182+ onClicked: pageStack.next() // TODO sign up against U1