Commit a9dc44f8 authored by Davide De Rosa's avatar Davide De Rosa
Browse files

Add login link to redeem page

parent bd070fa3
......@@ -12,6 +12,8 @@
"login.submit" = "LOGIN";
"login.purchase.footer" = "Don’t have an account?";
"login.purchase.button" = "Buy now!";
"login.redeem.footer" = "Have a gift card or trial card?";
"login.redeem.button" = "Redeem now!";
"login.restore.button" = "Couldn't get your plan?";
"login.error.title" = "Log in";
"login.error.validation" = "You must enter an username and password.";
......
......@@ -30,6 +30,12 @@ class LoginViewController: AutolayoutViewController, WelcomeChild {
@IBOutlet private weak var labelPurchase2: UILabel!
@IBOutlet private weak var viewRedeem: UIView!
@IBOutlet private weak var labelRedeem1: UILabel!
@IBOutlet private weak var labelRedeem2: UILabel!
@IBOutlet private weak var buttonRestorePurchase: UIButton!
var preset: PIAWelcomeViewController.Preset?
......@@ -55,6 +61,8 @@ class LoginViewController: AutolayoutViewController, WelcomeChild {
buttonLogin.title = L10n.Welcome.Login.submit
labelPurchase1.text = L10n.Welcome.Login.Purchase.footer
labelPurchase2.text = L10n.Welcome.Login.Purchase.button
labelRedeem1.text = L10n.Welcome.Login.Redeem.footer
labelRedeem2.text = L10n.Welcome.Login.Redeem.button
buttonRestorePurchase.setTitle(L10n.Welcome.Login.Restore.button, for: .normal)
buttonRestorePurchase.titleLabel?.textAlignment = .center
buttonRestorePurchase.titleLabel?.numberOfLines = 0
......@@ -151,6 +159,13 @@ class LoginViewController: AutolayoutViewController, WelcomeChild {
pageController.show(page: .purchase)
}
@IBAction private func redeem(_ sender: Any?) {
guard let pageController = parent as? WelcomePageViewController else {
fatalError("Not running in WelcomePageViewController")
}
pageController.show(page: .redeem)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if let vc = segue.destination as? RestoreSignupViewController {
vc.preset = preset
......@@ -192,6 +207,8 @@ class LoginViewController: AutolayoutViewController, WelcomeChild {
Theme.current.applyActionButton(buttonLogin)
Theme.current.applyBody1(labelPurchase1, appearance: .dark)
Theme.current.applyTextButton(labelPurchase2)
Theme.current.applyBody1(labelRedeem1, appearance: .dark)
Theme.current.applyTextButton(labelRedeem2)
Theme.current.applyTextButton(buttonRestorePurchase)
}
}
......
......@@ -63,6 +63,13 @@ enum L10n {
static let footer = L10n.tr("Welcome", "login.purchase.footer")
}
enum Redeem {
/// Redeem now!
static let button = L10n.tr("Welcome", "login.redeem.button")
/// Have a gift card or trial card?
static let footer = L10n.tr("Welcome", "login.redeem.footer")
}
enum Restore {
/// Couldn't get your plan?
static let button = L10n.tr("Welcome", "login.restore.button")
......@@ -246,7 +253,7 @@ enum L10n {
}
enum Redeem {
/// You will receive an email shortly with your username and password.
/// You will also receive an email shortly with your username and password.
static let message = L10n.tr("Signup", "success.redeem.message")
/// Completed!
static let title = L10n.tr("Signup", "success.redeem.title")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment