//
// AboutViewController.m
// Taketours
//
// Created by paul on 8/4/14.
//
//

#import "AboutViewController.h"
#import "SDK.h"
#import "CocoaUtils.h"
#import "Utility.h"
#import "Vars.h"

@interface AboutViewController ()
@property (nonatomic, weak) IBOutlet UILabel *versionLabel;
@property (nonatomic, weak) IBOutlet UILabel *aboutLabel;
@property (weak, nonatomic) IBOutlet UIButton *gotobusButton;
@end

@implementation AboutViewController

- (instancetype)init {
	self = [super init];
	if (self) {
		// Custom initialization
		self.edgesForExtendedLayout = UIRectEdgeNone;
		self.title = IMLocalizedString(@"About Us");
		[[Vars appDelegate] applyDefaultConfigurationForViewController:self];
	}
	return self;
}

- (void)viewDidLoad {
	[super viewDidLoad];
	
	NSMutableString *string = [NSMutableString string];
	[string im_appendString:IMLocalizedString(@"Version")];
	[string im_appendString:IMLocalizedString(PUNCTUATION_COLON)];
	[string im_appendString:IMLocalizedString(WORD_DIVIDER_SPACE)];
	[string im_appendString:[CocoaUtils bundleVersion]];
	self.versionLabel.text = [NSString stringWithString:string];

	self.aboutLabel.text = [NSString stringWithContentsOfFile:IMLocalizedPath(@"about", @"txt") encoding:NSUTF8StringEncoding error:NULL];
}

-(void)viewWillAppear:(BOOL)animated{
	[super viewWillAppear:animated];
	if ([Vars appDelegate].loginUser.is_support) {
		self.gotobusButton.hidden = NO;
	}else{
		self.gotobusButton.hidden = YES;
	}
}


@end
