diff --git a/AvH Plan/Base.lproj/Main.storyboard b/AvH Plan/Base.lproj/Main.storyboard
index e56b1a3..5f4657c 100644
--- a/AvH Plan/Base.lproj/Main.storyboard
+++ b/AvH Plan/Base.lproj/Main.storyboard
@@ -23,9 +23,7 @@
-
-
-
+
@@ -47,9 +45,7 @@
-
-
-
+
@@ -61,7 +57,7 @@
-
+
@@ -78,91 +74,190 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -183,7 +278,7 @@
-
+
@@ -318,7 +413,6 @@
-
@@ -328,6 +422,7 @@
+
@@ -357,7 +452,4 @@
-
-
-
diff --git a/AvH Plan/ColourPickerView.swift b/AvH Plan/ColourPickerView.swift
index 1dc19a4..5ba3da0 100644
--- a/AvH Plan/ColourPickerView.swift
+++ b/AvH Plan/ColourPickerView.swift
@@ -46,7 +46,7 @@ class ColourPickerView: UIViewController, UICollectionViewDataSource, UICollecti
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
- // For remove previously selection
+ // For removing the previous selection
if currentSelected != nil {
if let cell = collectionView.cellForItem(at: currentSelected!) as? ColourViewCell {
cell.imageView.image = UIImage(named: "ic_empty")
@@ -59,7 +59,7 @@ class ColourPickerView: UIViewController, UICollectionViewDataSource, UICollecti
currentSelected = indexPath
- // For reload the selected cell
+ // For reloading the selected cell
self.collectionView.reloadItems(at: [currentSelected!])
}
diff --git a/AvH Plan/CustomizationViewController.swift b/AvH Plan/CustomizationViewController.swift
index 833fb2e..c409085 100644
--- a/AvH Plan/CustomizationViewController.swift
+++ b/AvH Plan/CustomizationViewController.swift
@@ -24,10 +24,21 @@ class CustomizationViewController: UIViewController, UICollectionViewDataSource,
@IBOutlet weak var defaultSegments: UISegmentedControl!
@IBOutlet weak var textToolbar: UIToolbar!
- @IBAction func textDismissButton(_ sender: Any) {
+ @IBOutlet weak var inputsView: UIView!
+ @IBOutlet weak var colourView: UIView!
+
+ @IBAction func textDismissButton(_ sender: UIBarButtonItem) {
view.endEditing(true)
}
+ @IBAction func groupHelpButton(_ sender: UIButton) {
+ self.present(self.getAlert(for: "grade"), animated: true)
+ }
+
+ @IBAction func courseHelpButton(_ sender: UIButton) {
+ self.present(self.getAlert(for: "course"), animated: true)
+ }
+
func textFieldDidBeginEditing(_ textField: UITextField) {
textField.inputAccessoryView = textToolbar
}
@@ -126,4 +137,11 @@ class CustomizationViewController: UIViewController, UICollectionViewDataSource,
cell.backgroundColor = #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0)
return cell
}
+
+ func getAlert(for type: String) -> UIAlertController {
+ let alert = UIAlertController(title: NSLocalizedString("enter_\(type)_title", comment: ""), message: NSLocalizedString("enter_\(type)_help", comment: ""), preferredStyle: .alert)
+ alert.addAction(UIAlertAction(title: NSLocalizedString("dismiss", comment: ""), style: .default) { action in
+ })
+ return alert
+ }
}
diff --git a/AvH Plan/DataFetcher.swift b/AvH Plan/DataFetcher.swift
index 7123201..f208f5a 100644
--- a/AvH Plan/DataFetcher.swift
+++ b/AvH Plan/DataFetcher.swift
@@ -395,16 +395,6 @@ class DataFetcher {
let alert = UIAlertController(title: NSLocalizedString("information", comment: ""), message: self.readInformation(), preferredStyle: .alert)
alert.addAction(UIAlertAction(title: NSLocalizedString("dismiss", comment: ""), style: .default) { action in
})
- let paragraphStyle = NSMutableParagraphStyle()
- paragraphStyle.alignment = NSTextAlignment.left
- let messageText = NSMutableAttributedString(
- string: self.readInformation(),
- attributes: [
- NSAttributedString.Key.paragraphStyle: paragraphStyle,
- NSAttributedString.Key.font: UIFont.preferredFont(forTextStyle: UIFont.TextStyle.caption1)
- ]
- )
- alert.setValue(messageText, forKey: "attributedMessage")
return alert
} else {
return nil
diff --git a/AvH Plan/GeneralPlanViewController.swift b/AvH Plan/GeneralPlanViewController.swift
index 7967c83..00412c6 100644
--- a/AvH Plan/GeneralPlanViewController.swift
+++ b/AvH Plan/GeneralPlanViewController.swift
@@ -10,6 +10,12 @@ import UIKit
class GeneralViewController: PlanViewController {
+ @IBAction func customize(_ sender: UIBarButtonItem) {
+ if let s = storyboard?.instantiateViewController(withIdentifier: "Customize") as? CustomizationViewController {
+ self.present(s, animated: true)
+ }
+ }
+
override func viewDidLoad() {
super.viewDidLoad()
self.navigationController?.navigationBar.topItem?.title = NSLocalizedString("avh_plan", comment: "")
diff --git a/AvH Plan/PersonalPlanViewController.swift b/AvH Plan/PersonalPlanViewController.swift
index 9fecb50..ebf9095 100644
--- a/AvH Plan/PersonalPlanViewController.swift
+++ b/AvH Plan/PersonalPlanViewController.swift
@@ -12,6 +12,12 @@ class PersonalPlanViewController: PlanViewController {
let prefs = UserDefaults.standard
+ @IBAction func customize(_ sender: UIBarButtonItem) {
+ if let s = storyboard?.instantiateViewController(withIdentifier: "Customize") as? CustomizationViewController {
+ self.present(s, animated: true)
+ }
+ }
+
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
let user = self.prefs.string(forKey: "username")
diff --git a/AvH Plan/de.lproj/Localizable.strings b/AvH Plan/de.lproj/Localizable.strings
index 85e197e..3e4eadb 100644
--- a/AvH Plan/de.lproj/Localizable.strings
+++ b/AvH Plan/de.lproj/Localizable.strings
@@ -76,3 +76,8 @@
"back" = "Zurück";
"your_plan" = "Dein Plan";
"dismiss" = "Schließen";
+
+"enter_grade_title" = "Wie du deine Klasse eintragen kannst";
+"enter_course_title" = "Wie du deine Kurse eintragen kannst";
+"enter_grade_help" = "Trage deine derzeitige Klasse ein, damit sie in deinem persönlichen Plan auftaucht.\n\nAnmerkung:\n\nIn der Mittelstufe müssen Nummer und Buchstabe zusammen geschrieben werden, Beispiel: \"5a\".\n\nIn der E-Phase müssen diese durch ein Leerzeichen getrennt werden, Beispiel: \"18 a\".\n\nIn der Q1/Q2 sollen nur die Nummern eingetragen werden, Beispiel: \"17\".\n\nMehrere Klassen können nur eingetragen werden, wenn keine Kurse eingetragen sind.";
+"enter_course_help" = "Trag die Kürzel für die Kurse ein, welche in deinem persönlichen Plan auftauchen sollen. Du kannst diese auf deinem Stundenplan finden.\n\nHier sind einige Beispiele:\n\nMathe in der 5. Klasse (Mittelstufe) wäre MAT.\n\nDer Englisch-Profilkurs in der E-Phase könnte ENP1 sein.\n\nDer Bio-Grundkurs in der Q1 ist z.B. bio1.\n\nMeist müssen Kurse für Mittelstufenschüler nicht eingetragen werden.\nTrenne mehrere Kurse mit Leerzeichen, Kommas sind optional.\nGroß- und Kleinschreibung wird beachtet.";
diff --git a/AvH Plan/en.lproj/Localizable.strings b/AvH Plan/en.lproj/Localizable.strings
index d5a5790..2502fdc 100644
--- a/AvH Plan/en.lproj/Localizable.strings
+++ b/AvH Plan/en.lproj/Localizable.strings
@@ -77,3 +77,8 @@
"back" = "Back";
"your_plan" = "Your Plan";
"dismiss" = "Dismiss";
+
+"enter_grade_title" = "How to enter your grade";
+"enter_course_title" = "How to enter your courses";
+"enter_grade_help" = "Enter your current grade to have it appear in your personal plan.\n\nNote:\n\nIn junior phase, put the number and letter together, as in \"5a\".\n\nIn E-Phase, separate them by a space, as in \"18 a\".\n\nIn Q1/Q2, only put in the number, as in \"17\".\n\nMultiple grades can only be entered when no courses have been entered.";
+"enter_course_help" = "You need to enter the course abbreviation for every course you want in your personal plan. You can find them on your time table.\n\nHere\'s a few examples:\n\nMathematics in 5th grade (juniors) would be MAT.\n\nAdvanced English in E-Phase (seniors) for the English profile may be ENP1.\n\nBasic Biology in Q1 could be bio1.\n\nIn most cases, entering courses while in junior phase is redundant.\nSeparate multiple courses by spaces, commas are optional.\nCapitalisation is required.";