diff options
| author | Ronny Fenrich <Fenrich@Gmail.com> | 2013-06-13 16:21:41 -0600 |
|---|---|---|
| committer | Ronny Fenrich <Fenrich@Gmail.com> | 2013-06-13 16:21:41 -0600 |
| commit | 2b581c85487287d3fb03396e4b13c304bdffa6ab (patch) | |
| tree | d10e325aee2e9f3e1b3a808bbd8dd301f8e92d74 /Volta | |
| parent | b1dc9d1458dcc1d4220e961d1b50169b660efac6 (diff) | |
Finished Login and basic UI for Stats selection
Diffstat (limited to 'Volta')
| -rw-r--r-- | Volta/Views/LoginViewController.m | 2 | ||||
| -rw-r--r-- | Volta/Views/StatsViewController.h | 13 | ||||
| -rw-r--r-- | Volta/Views/StatsViewController.m | 53 | ||||
| -rw-r--r-- | Volta/Volta-Prefix.pch | 2 | ||||
| -rw-r--r-- | Volta/en.lproj/MainStoryboard.storyboard | 108 |
5 files changed, 139 insertions, 39 deletions
diff --git a/Volta/Views/LoginViewController.m b/Volta/Views/LoginViewController.m index 4f3b10a..4ae5862 100644 --- a/Volta/Views/LoginViewController.m +++ b/Volta/Views/LoginViewController.m @@ -164,7 +164,7 @@ NSLog(@"%@", JSON); // check if login was successfull - NSString *token = [JSON objectForKey:@"token"]; + NSString *token = [JSON objectForKey:@"auth_token"]; if (!token || [token isEmpty]) { [self.HUD hide:YES]; diff --git a/Volta/Views/StatsViewController.h b/Volta/Views/StatsViewController.h new file mode 100644 index 0000000..87bf054 --- /dev/null +++ b/Volta/Views/StatsViewController.h @@ -0,0 +1,13 @@ +// +// StatsViewController.h +// Volta +// +// Created by Ronny Fenrich on 2013-06-13. +// Copyright (c) 2013 Decoder. All rights reserved. +// + +#import <UIKit/UIKit.h> + +@interface StatsViewController : UIViewController + +@end diff --git a/Volta/Views/StatsViewController.m b/Volta/Views/StatsViewController.m new file mode 100644 index 0000000..baa1976 --- /dev/null +++ b/Volta/Views/StatsViewController.m @@ -0,0 +1,53 @@ +// +// StatsViewController.m +// Volta +// +// Created by Ronny Fenrich on 2013-06-13. +// Copyright (c) 2013 Decoder. All rights reserved. +// + +#import "StatsViewController.h" + +@interface StatsViewController () + +@property (weak, nonatomic) IBOutlet UITextField *startDate; +@property (weak, nonatomic) IBOutlet UITextField *endDate; +@property (weak, nonatomic) IBOutlet UIScrollView *content; + +@end + +@implementation StatsViewController + + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.navigationController.navigationBarHidden = NO; + self.navigationItem.hidesBackButton = YES; + self.navigationController.navigationBar.barStyle = UIBarStyleBlack; +} + +- (IBAction)statsCurrentMonth:(id)sender +{ + +} + +- (IBAction)statsLast30days:(id)sender { +} + +- (IBAction)statsLast60days:(id)sender { +} + +- (IBAction)statsCurrentYear:(id)sender { +} + +- (IBAction)statsStartdateEnddate:(id)sender { +} +- (void)viewDidUnload { + [self setStartDate:nil]; + [self setEndDate:nil]; + [self setContent:nil]; + [super viewDidUnload]; +} +@end diff --git a/Volta/Volta-Prefix.pch b/Volta/Volta-Prefix.pch index 3861be7..f196b32 100644 --- a/Volta/Volta-Prefix.pch +++ b/Volta/Volta-Prefix.pch @@ -35,7 +35,7 @@ #define HOST @"http://fast-gorge-5977.herokuapp.com" // DEV #define URL_TOKEN @"?token=%@" -#define URL_LOGIN @"/login" +#define URL_LOGIN @"/api/v1/logins" #define URL_LOGOUT @"/logout" //#define URL_UPDATE_USER [@"/api/users/%d" stringByAppendingString:URL_TOKEN] diff --git a/Volta/en.lproj/MainStoryboard.storyboard b/Volta/en.lproj/MainStoryboard.storyboard index 2531538..dafe5e6 100644 --- a/Volta/en.lproj/MainStoryboard.storyboard +++ b/Volta/en.lproj/MainStoryboard.storyboard @@ -9,46 +9,46 @@ <objects> <viewController id="2" customClass="LoginViewController" sceneMemberID="viewController"> <view key="view" contentMode="scaleToFill" id="3"> - <rect key="frame" x="0.0" y="20" width="568" height="300"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> + <rect key="frame" x="0.0" y="20" width="480" height="300"/> + <autoresizingMask key="autoresizingMask"/> <subviews> <view contentMode="scaleToFill" id="uqJ-49-w8p"> - <rect key="frame" x="0.0" y="0.0" width="568" height="241"/> + <rect key="frame" x="0.0" y="0.0" width="480" height="241"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" image="arc.png" id="Ixb-r1-Hqj"> - <rect key="frame" x="0.0" y="-5" width="568" height="100"/> + <rect key="frame" x="0.0" y="-5" width="480" height="100"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> </imageView> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Email address" minimumFontSize="17" clearButtonMode="whileEditing" id="4Wx-1t-eWb"> - <rect key="frame" x="88" y="158" width="160" height="30"/> + <rect key="frame" x="64" y="158" width="170" height="30"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <fontDescription key="fontDescription" type="system" pointSize="18"/> + <fontDescription key="fontDescription" type="system" pointSize="17"/> <textInputTraits key="textInputTraits" returnKeyType="next"/> <connections> <outlet property="delegate" destination="2" id="KQv-28-eUu"/> </connections> </textField> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Password" minimumFontSize="17" clearButtonMode="whileEditing" id="8gW-e7-dmr"> - <rect key="frame" x="320" y="158" width="160" height="30"/> + <rect key="frame" x="245" y="158" width="170" height="30"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> - <fontDescription key="fontDescription" type="system" pointSize="18"/> - <textInputTraits key="textInputTraits" returnKeyType="go"/> + <fontDescription key="fontDescription" type="system" pointSize="17"/> + <textInputTraits key="textInputTraits" returnKeyType="go" secureTextEntry="YES"/> <connections> <outlet property="delegate" destination="2" id="Rn3-Vi-9zm"/> </connections> </textField> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Please login to your Volta account..." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="4Qw-4O-HqB"> - <rect key="frame" x="0.0" y="114" width="568" height="29"/> - <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> + <rect key="frame" x="0.0" y="114" width="480" height="29"/> + <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="21"/> <color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> <nil key="highlightedColor"/> </label> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" id="qNQ-ju-GIV"> - <rect key="frame" x="203" y="204" width="162" height="34"/> + <rect key="frame" x="159" y="204" width="162" height="34"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> <color key="backgroundColor" red="0.074509806931018829" green="0.062745101749897003" blue="0.29019609093666077" alpha="1" colorSpace="deviceRGB"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/> @@ -97,7 +97,7 @@ <objects> <viewController id="jXX-Hl-vMK" sceneMemberID="viewController"> <view key="view" contentMode="scaleToFill" id="RNT-pX-Ndy"> - <rect key="frame" x="0.0" y="20" width="568" height="251"/> + <rect key="frame" x="0.0" y="64" width="480" height="207"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/> @@ -113,7 +113,7 @@ <objects> <viewController id="iov-Wj-U1x" sceneMemberID="viewController"> <view key="view" contentMode="scaleToFill" id="frN-a3-8Kd"> - <rect key="frame" x="0.0" y="20" width="568" height="251"/> + <rect key="frame" x="0.0" y="64" width="480" height="207"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/> @@ -144,21 +144,21 @@ </objects> <point key="canvasLocation" x="939" y="582"/> </scene> - <!--View Controller - Select Time Period--> + <!--Stats View Controller - Select Time Period--> <scene sceneID="quO-Wa-U6p"> <objects> - <viewController id="lv2-8L-bY1" sceneMemberID="viewController"> + <viewController id="lv2-8L-bY1" customClass="StatsViewController" sceneMemberID="viewController"> <view key="view" contentMode="scaleToFill" id="HAf-JS-Kd2"> - <rect key="frame" x="0.0" y="20" width="568" height="300"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> + <rect key="frame" x="0.0" y="64" width="480" height="256"/> + <autoresizingMask key="autoresizingMask"/> <subviews> <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="UXO-Vt-5K9"> - <rect key="frame" x="0.0" y="44" width="568" height="256"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> + <rect key="frame" x="0.0" y="0.0" width="480" height="256"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Start Date" minimumFontSize="17" id="FTW-dx-T0r"> - <rect key="frame" x="76" y="184" width="160" height="30"/> - <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> + <rect key="frame" x="72" y="185" width="120" height="30"/> + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <fontDescription key="fontDescription" type="system" pointSize="18"/> <textInputTraits key="textInputTraits" returnKeyType="next"/> @@ -167,7 +167,7 @@ </connections> </textField> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" id="cuU-tX-8gu"> - <rect key="frame" x="454" y="182" width="92" height="34"/> + <rect key="frame" x="368" y="183" width="92" height="34"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> <color key="backgroundColor" red="0.074509806930000005" green="0.062745101750000004" blue="0.29019609089999998" alpha="1" colorSpace="deviceRGB"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/> @@ -178,10 +178,13 @@ <state key="highlighted"> <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> </state> + <connections> + <action selector="statsStartdateEnddate:" destination="lv2-8L-bY1" eventType="touchUpInside" id="1Ce-Zq-1SS"/> + </connections> </button> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" id="PJM-6d-TeN"> - <rect key="frame" x="20" y="98" width="528" height="34"/> - <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> + <rect key="frame" x="20" y="99" width="440" height="34"/> + <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> <color key="backgroundColor" red="0.074509806930000005" green="0.062745101750000004" blue="0.29019609089999998" alpha="1" colorSpace="deviceRGB"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/> <state key="normal" title="Last 60 days"> @@ -191,10 +194,13 @@ <state key="highlighted"> <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> </state> + <connections> + <action selector="statsLast60days:" destination="lv2-8L-bY1" eventType="touchUpInside" id="jRX-gU-WT7"/> + </connections> </button> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" id="X35-Uk-NCu"> - <rect key="frame" x="20" y="140" width="528" height="34"/> - <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> + <rect key="frame" x="20" y="141" width="440" height="34"/> + <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> <color key="backgroundColor" red="0.074509806930000005" green="0.062745101750000004" blue="0.29019609089999998" alpha="1" colorSpace="deviceRGB"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/> <state key="normal" title="Current Year (2013)"> @@ -204,10 +210,13 @@ <state key="highlighted"> <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> </state> + <connections> + <action selector="statsCurrentYear:" destination="lv2-8L-bY1" eventType="touchUpInside" id="yoX-HF-OY9"/> + </connections> </button> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" id="hCt-Nf-lhx"> - <rect key="frame" x="20" y="55" width="528" height="34"/> - <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> + <rect key="frame" x="20" y="56" width="440" height="34"/> + <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> <color key="backgroundColor" red="0.074509806930000005" green="0.062745101750000004" blue="0.29019609089999998" alpha="1" colorSpace="deviceRGB"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/> <state key="normal" title="Last 30 days"> @@ -217,10 +226,13 @@ <state key="highlighted"> <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> </state> + <connections> + <action selector="statsLast30days:" destination="lv2-8L-bY1" eventType="touchUpInside" id="A8M-3A-eP8"/> + </connections> </button> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="End Date" minimumFontSize="17" id="7zh-ce-be2"> - <rect key="frame" x="277" y="184" width="160" height="30"/> - <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> + <rect key="frame" x="240" y="185" width="120" height="30"/> + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <fontDescription key="fontDescription" type="system" pointSize="18"/> <textInputTraits key="textInputTraits" returnKeyType="next"/> @@ -229,8 +241,8 @@ </connections> </textField> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" id="Prl-07-V0C"> - <rect key="frame" x="20" y="13" width="528" height="34"/> - <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> + <rect key="frame" x="20" y="14" width="440" height="34"/> + <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> <color key="backgroundColor" red="0.074509806930000005" green="0.062745101750000004" blue="0.29019609089999998" alpha="1" colorSpace="deviceRGB"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/> <state key="normal" title="Current Month (June 2013)"> @@ -240,16 +252,19 @@ <state key="highlighted"> <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> </state> + <connections> + <action selector="statsCurrentMonth:" destination="lv2-8L-bY1" eventType="touchUpInside" id="dec-87-RSg"/> + </connections> </button> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="From" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="0zU-1a-0yD"> - <rect key="frame" x="23" y="188" width="40" height="21"/> + <rect key="frame" x="23" y="189" width="40" height="21"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> <nil key="highlightedColor"/> </label> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="to" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="GM9-Lw-EXV"> - <rect key="frame" x="250" y="188" width="15" height="21"/> + <rect key="frame" x="205" y="189" width="23" height="21"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> @@ -262,8 +277,11 @@ <simulatedOrientationMetrics key="simulatedOrientationMetrics" orientation="landscapeRight"/> </view> <navigationItem key="navigationItem" title="Select Time Period" id="vag-rM-2cb"/> - <simulatedNavigationBarMetrics key="simulatedTopBarMetrics" barStyle="blackTranslucent" prompted="NO"/> + <simulatedNavigationBarMetrics key="simulatedTopBarMetrics" barStyle="blackOpaque" prompted="NO"/> <connections> + <outlet property="content" destination="UXO-Vt-5K9" id="X3H-dT-rMp"/> + <outlet property="endDate" destination="7zh-ce-be2" id="fH7-nO-NBJ"/> + <outlet property="startDate" destination="FTW-dx-T0r" id="HE0-Xi-coM"/> <segue destination="f4D-Nl-1Q5" kind="push" id="irZ-KB-Vgl"/> </connections> </viewController> @@ -299,16 +317,32 @@ <class className="LoginViewController" superclassName="UIViewController"> <source key="sourceIdentifier" type="project" relativePath="./Classes/LoginViewController.h"/> <relationships> + <relationship kind="action" name="backgroundTapped:"/> + <relationship kind="action" name="dismissKeyboard:"/> + <relationship kind="action" name="login:"/> <relationship kind="outlet" name="contentView" candidateClass="UIView"/> <relationship kind="outlet" name="email" candidateClass="UITextField"/> <relationship kind="outlet" name="logo" candidateClass="UIImageView"/> <relationship kind="outlet" name="password" candidateClass="UITextField"/> </relationships> </class> + <class className="StatsViewController" superclassName="UIViewController"> + <source key="sourceIdentifier" type="project" relativePath="./Classes/StatsViewController.h"/> + <relationships> + <relationship kind="action" name="statsCurrentMonth:"/> + <relationship kind="action" name="statsCurrentYear:"/> + <relationship kind="action" name="statsLast30days:"/> + <relationship kind="action" name="statsLast60days:"/> + <relationship kind="action" name="statsStartdateEnddate:"/> + <relationship kind="outlet" name="content" candidateClass="UIScrollView"/> + <relationship kind="outlet" name="endDate" candidateClass="UITextField"/> + <relationship kind="outlet" name="startDate" candidateClass="UITextField"/> + </relationships> + </class> </classes> <simulatedMetricsContainer key="defaultSimulatedMetrics"> <simulatedStatusBarMetrics key="statusBar"/> <simulatedOrientationMetrics key="orientation"/> - <simulatedScreenMetrics key="destination" type="retina4"/> + <simulatedScreenMetrics key="destination"/> </simulatedMetricsContainer> </document>
\ No newline at end of file |
