@@ -0,0 +1,163 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
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.
7+ *
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.
12+ *
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/>.
15+ */
16+
17+import QtQuick 2.3
18+import Ubuntu.Components 1.2
19+import ".." as LocalComponents
20+
21+LocalComponents.Page {
22+ objectName: "ubuntuAccountSignUpPage"
23+
24+ title: i18n.tr("Create Account")
25+ customTitle: true
26+ backButtonText: i18n.tr("Cancel")
27+ forwardButtonSourceComponent: forwardButton
28+
29+ Component.onCompleted: {
30+ emailInput.forceActiveFocus()
31+ }
32+
33+ Item {
34+ id: column
35+ anchors.fill: content
36+
37+ // email
38+ Label {
39+ id: emailLabel
40+ anchors.left: parent.left
41+ anchors.right: parent.right
42+ wrapMode: Text.Wrap
43+ text: i18n.tr("Email:")
44+ color: "#525252"
45+ font.weight: Font.Light
46+ }
47+
48+ TextField {
49+ id: emailInput
50+ anchors.left: parent.left
51+ anchors.right: parent.right
52+ anchors.top: emailLabel.bottom
53+ anchors.topMargin: units.gu(1)
54+ inputMethodHints: Qt.ImhEmailCharactersOnly
55+ validator: RegExpValidator {
56+ regExp: /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i
57+ }
58+ KeyNavigation.tab: nameInput
59+ }
60+
61+ // name
62+ Label {
63+ id: nameLabel
64+ anchors.left: parent.left
65+ anchors.right: parent.right
66+ anchors.top: emailInput.bottom
67+ anchors.topMargin: units.gu(3)
68+ wrapMode: Text.Wrap
69+ text: i18n.tr("Your name:")
70+ color: "#525252"
71+ font.weight: Font.Light
72+ }
73+
74+ TextField {
75+ id: nameInput
76+ anchors.left: parent.left
77+ anchors.right: parent.right
78+ anchors.top: nameLabel.bottom
79+ anchors.topMargin: units.gu(1)
80+ KeyNavigation.tab: passInput
81+ }
82+
83+ // password
84+ Label {
85+ id: passLabel
86+ anchors.left: parent.left
87+ anchors.right: parent.right
88+ anchors.top: nameInput.bottom
89+ anchors.topMargin: units.gu(3)
90+ wrapMode: Text.Wrap
91+ text: i18n.tr("Password:")
92+ color: "#525252"
93+ font.weight: Font.Light
94+ }
95+
96+ TextField {
97+ id: passInput
98+ anchors.left: parent.left
99+ anchors.right: parent.right
100+ anchors.top: passLabel.bottom
101+ anchors.topMargin: units.gu(1)
102+ echoMode: TextInput.Password
103+ KeyNavigation.tab: pass2Input
104+ }
105+
106+ // repeat password
107+ Label {
108+ id: pass2Label
109+ anchors.left: parent.left
110+ anchors.right: parent.right
111+ anchors.top: passInput.bottom
112+ anchors.topMargin: units.gu(3)
113+ wrapMode: Text.Wrap
114+ text: i18n.tr("Repeat password:")
115+ color: "#525252"
116+ font.weight: Font.Light
117+ }
118+
119+ TextField {
120+ id: pass2Input
121+ anchors.left: parent.left
122+ anchors.right: parent.right
123+ anchors.top: pass2Label.bottom
124+ anchors.topMargin: units.gu(1)
125+ echoMode: TextInput.Password
126+ KeyNavigation.tab: optoutCheck
127+ }
128+
129+ LocalComponents.CheckableSetting {
130+ id: optoutCheck
131+ objectName: "optoutCheck"
132+ showDivider: false
133+ anchors.left: parent.left
134+ anchors.right: parent.right
135+ anchors.top: pass2Input.bottom
136+ anchors.topMargin: units.gu(3)
137+ text: i18n.tr("Opt out of cloud account (not recommended)")
138+ KeyNavigation.tab: termsCheck
139+ }
140+
141+ LocalComponents.CheckableSetting {
142+ id: termsCheck
143+ objectName: "termsCheck"
144+ showDivider: false
145+ anchors.left: parent.left
146+ anchors.right: parent.right
147+ anchors.top: optoutCheck.bottom
148+ anchors.topMargin: units.gu(1)
149+ text: i18n.tr("I have read and accept the Ubuntu account <a href='#'>terms of service</a>")
150+ //onLinkActivated: pageStack.load(Qt.resolvedUrl("here-terms.qml")) // TODO show terms
151+ KeyNavigation.tab: emailInput
152+ }
153+ }
154+
155+ Component {
156+ id: forwardButton
157+ LocalComponents.StackButton {
158+ enabled: emailInput.acceptableInput && passInput.text !== "" && pass2Input.text !== "" && passInput.text === pass2Input.text
159+ text: i18n.tr("Sign Up")
160+ onClicked: pageStack.next() // TODO sign up against U1
161+ }
162+ }
163+}