소스 검색

Activities section implemented.

Iñigo Valentin 9 년 전
부모
커밋
8d25effe17

+ 32 - 0
app.xcodeproj/project.pbxproj

@@ -53,6 +53,14 @@
 		93D9EA6C1DE3498500089002 /* HomeView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 93D9EA6B1DE3498500089002 /* HomeView.xib */; };
 		93D9EA711DE37C7900089002 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 93D9EA701DE37C7900089002 /* libsqlite3.tbd */; };
 		93D9EA761DE3ACBB00089002 /* Sync.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93D9EA751DE3ACBB00089002 /* Sync.swift */; };
+		93E0C5E21EB7E7F000905811 /* ActivitiesView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 93E0C5E11EB7E7F000905811 /* ActivitiesView.xib */; };
+		93E0C5E41EB7E94300905811 /* ActivitiesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93E0C5E31EB7E94300905811 /* ActivitiesView.swift */; };
+		93E0C5E61EBDEF2B00905811 /* RowFutureActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93E0C5E51EBDEF2B00905811 /* RowFutureActivity.swift */; };
+		93E0C5E81EBDF0E700905811 /* RowFutureActivity.xib in Resources */ = {isa = PBXBuildFile; fileRef = 93E0C5E71EBDF0E700905811 /* RowFutureActivity.xib */; };
+		93E0C5EA1EBDFFB400905811 /* RowPastActivity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93E0C5E91EBDFFB300905811 /* RowPastActivity.swift */; };
+		93E0C5EC1EBE001000905811 /* RowPastActivity.xib in Resources */ = {isa = PBXBuildFile; fileRef = 93E0C5EB1EBE000F00905811 /* RowPastActivity.xib */; };
+		93E0C5EE1EBE25BD00905811 /* RowLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93E0C5ED1EBE25BC00905811 /* RowLabel.swift */; };
+		93E0C5F21EBE264F00905811 /* RowLabel.xib in Resources */ = {isa = PBXBuildFile; fileRef = 93E0C5F11EBE264F00905811 /* RowLabel.xib */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
@@ -104,6 +112,14 @@
 		93D9EA6B1DE3498500089002 /* HomeView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HomeView.xib; sourceTree = "<group>"; };
 		93D9EA701DE37C7900089002 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; };
 		93D9EA751DE3ACBB00089002 /* Sync.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Sync.swift; sourceTree = "<group>"; };
+		93E0C5E11EB7E7F000905811 /* ActivitiesView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ActivitiesView.xib; sourceTree = "<group>"; };
+		93E0C5E31EB7E94300905811 /* ActivitiesView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActivitiesView.swift; sourceTree = "<group>"; };
+		93E0C5E51EBDEF2B00905811 /* RowFutureActivity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RowFutureActivity.swift; sourceTree = "<group>"; };
+		93E0C5E71EBDF0E700905811 /* RowFutureActivity.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RowFutureActivity.xib; sourceTree = "<group>"; };
+		93E0C5E91EBDFFB300905811 /* RowPastActivity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RowPastActivity.swift; sourceTree = "<group>"; };
+		93E0C5EB1EBE000F00905811 /* RowPastActivity.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RowPastActivity.xib; sourceTree = "<group>"; };
+		93E0C5ED1EBE25BC00905811 /* RowLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RowLabel.swift; sourceTree = "<group>"; };
+		93E0C5F11EBE264F00905811 /* RowLabel.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RowLabel.xib; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -184,6 +200,14 @@
 				938D211E1EA2306300C47EC3 /* LablancaView.swift */,
 				9326C4F31EA51C39007DF2A4 /* RowLablancaDay.xib */,
 				9326C4F51EA5279D007DF2A4 /* RowLablancaDay.swift */,
+				93E0C5E11EB7E7F000905811 /* ActivitiesView.xib */,
+				93E0C5E31EB7E94300905811 /* ActivitiesView.swift */,
+				93E0C5E51EBDEF2B00905811 /* RowFutureActivity.swift */,
+				93E0C5E71EBDF0E700905811 /* RowFutureActivity.xib */,
+				93E0C5E91EBDFFB300905811 /* RowPastActivity.swift */,
+				93E0C5EB1EBE000F00905811 /* RowPastActivity.xib */,
+				93E0C5ED1EBE25BC00905811 /* RowLabel.swift */,
+				93E0C5F11EBE264F00905811 /* RowLabel.xib */,
 			);
 			path = app;
 			sourceTree = "<group>";
@@ -257,13 +281,17 @@
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				93E0C5E21EB7E7F000905811 /* ActivitiesView.xib in Resources */,
 				931AA5AE1E218D0E003A2290 /* Entry.xib in Resources */,
+				93E0C5E81EBDF0E700905811 /* RowFutureActivity.xib in Resources */,
 				938D211D1EA2275300C47EC3 /* LablancaView.xib in Resources */,
 				93075C721E59D06900396389 /* RowBlog.xib in Resources */,
 				93B84BA71D9C31AB006C0F67 /* LaunchScreen.storyboard in Resources */,
 				93BAD2F61E586310009DF853 /* RowHomeSocial.xib in Resources */,
 				93BAD2F21E585E88009DF853 /* RowHomeFutureActivities.xib in Resources */,
 				931AA5B01E219006003A2290 /* RowHomePastActivities.xib in Resources */,
+				93E0C5F21EBE264F00905811 /* RowLabel.xib in Resources */,
+				93E0C5EC1EBE001000905811 /* RowPastActivity.xib in Resources */,
 				936966EF1E9848D600A11055 /* RowAlbum.xib in Resources */,
 				93D9EA601DE271E700089002 /* Section.xib in Resources */,
 				93075C6A1E59CAB000396389 /* BlogView.xib in Resources */,
@@ -290,6 +318,7 @@
 				936966F11E984B5000A11055 /* RowAlbum.swift in Sources */,
 				93D9EA641DE273FD00089002 /* Section.swift in Sources */,
 				93D9EA6A1DE3491100089002 /* HomeView.swift in Sources */,
+				93E0C5EE1EBE25BD00905811 /* RowLabel.swift in Sources */,
 				93BEB6D21E7E878300C68DE5 /* PostViewController.swift in Sources */,
 				93BAD2F81E586741009DF853 /* RowHomeSocial.swift in Sources */,
 				9326C4F61EA5279D007DF2A4 /* RowLablancaDay.swift in Sources */,
@@ -298,6 +327,7 @@
 				93B5C01A1E872B4B0069BFF8 /* RowHomeGallery.swift in Sources */,
 				935892D01E493C2300E1CD5F /* UIImageView.swift in Sources */,
 				93D9EA761DE3ACBB00089002 /* Sync.swift in Sources */,
+				93E0C5EA1EBDFFB400905811 /* RowPastActivity.swift in Sources */,
 				93BAD2F41E585EE6009DF853 /* RowHomeFutureActivities.swift in Sources */,
 				931AA5891E1AFF8C003A2290 /* String.swift in Sources */,
 				93B84B9C1D9C31AB006C0F67 /* ViewController.swift in Sources */,
@@ -309,7 +339,9 @@
 				93D9EA681DE342AC00089002 /* UIView.swift in Sources */,
 				938D211F1EA2306300C47EC3 /* LablancaView.swift in Sources */,
 				93075C701E59D04A00396389 /* RowBlog.swift in Sources */,
+				93E0C5E41EB7E94300905811 /* ActivitiesView.swift in Sources */,
 				93B408031D9ED44C000FBC99 /* MenuCollectionViewCell.swift in Sources */,
+				93E0C5E61EBDEF2B00905811 /* RowFutureActivity.swift in Sources */,
 				935D6E2F1E86792000CED3A1 /* GalleryView.swift in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;

+ 247 - 0
app/ActivitiesView.swift

@@ -0,0 +1,247 @@
+// Copyright (C) 2016 Inigo Valentin
+//
+// This file is part of the Gasteizko Margolariak IOS app.
+//
+// The Gasteizko Margolariak IOS app is free software: you can
+// redistribute it and/or modify it under the terms of the
+// GNU General Public License as published by the Free Software
+// Foundation, either version 3 of the License, or (at your
+// option) any later version.
+//
+// The Gasteizko Margolariak IOS app is distributed in the
+// hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+// Public License for more details.
+//
+// You should have received a copy of the GNU General Public
+// License along with the Gasteizko Margolariak IOS app.
+// If not, see <http://www.gnu.org/licenses/>.
+
+import Foundation
+import CoreData
+import UIKit
+/**
+Class to handle the home view.
+*/
+class ActivitiesView: UIView {
+	
+	@IBOutlet var container: ActivitiesView!
+	@IBOutlet weak var futureSection: Section!
+	@IBOutlet weak var pastSection: Section!
+
+	var delegate: AppDelegate? = nil
+	
+	override init(frame: CGRect){
+		super.init(frame: frame)
+	}
+	
+	/**
+	Run when the view is started.
+	*/
+	required init?(coder aDecoder: NSCoder) {
+		
+		super.init(coder: aDecoder)
+		
+		NSLog(":ACTIVITIES:DEBUG: init.")
+		
+		//Load the contents of the HomeView.xib file.
+		Bundle.main.loadNibNamed("ActivitiesView", owner: self, options: nil)
+		self.addSubview(container)
+		container.frame = self.bounds
+		futureSection.setTitle(text: "Próximas actividades")
+		pastSection.setTitle(text: "Últimas actividades")
+		let futureParent = futureSection.getContentStack()
+		let pastParent = pastSection.getContentStack()
+		
+		// Get viewController from StoryBoard
+		let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
+		let controller = storyboard.instantiateViewController(withIdentifier: "GMViewController") as! ViewController
+		
+		
+		let context = NSManagedObjectContext(concurrencyType: .privateQueueConcurrencyType)
+		let appDelegate = UIApplication.shared.delegate as! AppDelegate
+		self.delegate = appDelegate
+		let lang : String = getLanguage()
+		context.persistentStoreCoordinator = appDelegate.persistentStoreCoordinator
+		
+		// Show future activities
+		var fetchRequest: NSFetchRequest<Activity> = Activity.fetchRequest()
+		var sortDescriptor = NSSortDescriptor(key: "date", ascending: true)
+		var sortDescriptors = [sortDescriptor]
+		fetchRequest.sortDescriptors = sortDescriptors
+		fetchRequest.predicate = NSPredicate(format: "date > %@", NSDate())
+		
+		do {
+			let searchResults = try context.fetch(fetchRequest)
+			NSLog(":ACTIVITIES:DEBUG: Total future activities: \(searchResults.count)")
+			if searchResults.count == 0{
+				NSLog(":ACTIVITIES:DEBUG: No future activities: \(searchResults.count)")
+				let row: RowLabel = RowLabel.init(s: "rowFutureActivity0", i: 0)
+				row.setText(text: "No hay actividades planeadas proximamente. Pronto organizaremos algo!")
+				futureParent.addArrangedSubview(row)
+			}
+			else{
+
+			
+				var row : RowFutureActivity
+				var count = 0
+				var id: Int
+				var title: String
+				var text: String
+				var image: String
+				var city: String
+				var price: Int
+				var date: NSDate
+			
+				for r in searchResults as [NSManagedObject] {
+					count = count + 1
+					NSLog(":ACTIVITIES:DEBUG: Activity perm: \(r.value(forKey: "permalink"))")
+				
+					// Create a new row
+					row = RowFutureActivity.init(s: "rowFutureActivity\(count)", i: count)
+					id = r.value(forKey: "id")! as! Int
+					title = r.value(forKey: "title_\(lang)")! as! String
+					text = r.value(forKey: "text_\(lang)")! as! String
+					city = r.value(forKey: "city")! as! String
+					price = r.value(forKey: "price")! as! Int
+					date = r.value(forKey: "date")! as! NSDate
+					row.setTitle(text: title)
+					row.setText(text: text)
+					row.setPrice(price: price)
+					row.setCity(text: city)
+					row.setDate(date: date, lang: lang)
+				
+					// Get main image
+					image = ""
+					let imgFetchRequest: NSFetchRequest<Activity_image> = Activity_image.fetchRequest()
+					let imgSortDescriptor = NSSortDescriptor(key: "idx", ascending: true)
+					let imgSortDescriptors = [imgSortDescriptor]
+					imgFetchRequest.sortDescriptors = imgSortDescriptors
+					imgFetchRequest.predicate = NSPredicate(format: "activity == %i", id)
+					imgFetchRequest.fetchLimit = 1
+					do{
+						let imgSearchResults = try context.fetch(imgFetchRequest)
+						for imgR in imgSearchResults as [NSManagedObject]{
+							image = imgR.value(forKey: "image")! as! String
+							NSLog(":ACTIVITIES:DEBUG: Image: \(image)")
+							row.setImage(filename: image)
+						}
+					} catch {
+						NSLog(":ACTIVITIES:ERROR: Error getting image for activity \(id): \(error)")
+					}
+				
+					futureParent.addArrangedSubview(row)
+					row.setNeedsLayout()
+					row.layoutIfNeeded()
+				
+					// TODO: Do this on the row didLoad method
+					// Set tap recognizer
+					//let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(openActivity(_:)))
+					//row.isUserInteractionEnabled = true
+					//row.addGestureRecognizer(tapRecognizer)
+				
+				
+				
+				}
+			}
+		} catch {
+			NSLog(":ACTIVITIES:ERROR: Error with request: \(error)")
+		}
+		
+		
+		
+		// Show past activities
+		fetchRequest = Activity.fetchRequest()
+		sortDescriptor = NSSortDescriptor(key: "date", ascending: false)
+		sortDescriptors = [sortDescriptor]
+		fetchRequest.sortDescriptors = sortDescriptors
+		fetchRequest.predicate = NSPredicate(format: "date < %@", NSDate())
+		
+		do {
+			let searchResults = try context.fetch(fetchRequest)
+			NSLog(":ACTIVITIES:DEBUG: Total past activities: \(searchResults.count)")
+			
+			var row : RowPastActivity
+			var count = 0
+			var id: Int
+			var title: String
+			var text: String
+			var image: String
+			
+			for r in searchResults as [NSManagedObject] {
+				count = count + 1
+				NSLog(":ACTIVITIES:DEBUG: Activity perm: \(r.value(forKey: "permalink"))")
+				
+				// Create a new row
+				row = RowPastActivity.init(s: "rowPastActivity\(count)", i: count)
+				id = r.value(forKey: "id")! as! Int
+				title = r.value(forKey: "title_\(lang)")! as! String
+				text = r.value(forKey: "text_\(lang)")! as! String
+				row.setTitle(text: title)
+				row.setText(text: text)
+				
+				// Get main image
+				image = ""
+				let imgFetchRequest: NSFetchRequest<Activity_image> = Activity_image.fetchRequest()
+				let imgSortDescriptor = NSSortDescriptor(key: "idx", ascending: true)
+				let imgSortDescriptors = [imgSortDescriptor]
+				imgFetchRequest.sortDescriptors = imgSortDescriptors
+				imgFetchRequest.predicate = NSPredicate(format: "activity == %i", id)
+				imgFetchRequest.fetchLimit = 1
+				do{
+					let imgSearchResults = try context.fetch(imgFetchRequest)
+					for imgR in imgSearchResults as [NSManagedObject]{
+						image = imgR.value(forKey: "image")! as! String
+						NSLog(":ACTIVITIES:DEBUG: Image: \(image)")
+						row.setImage(filename: image)
+					}
+				} catch {
+					NSLog(":ACTIVITIES:ERROR: Error getting image for activity \(id): \(error)")
+				}
+				
+				NSLog(":ACTIVITIES:DEBUG: Row height: \(row.frame.height)")
+				
+				pastParent.addArrangedSubview(row)
+				row.setNeedsLayout()
+				row.layoutIfNeeded()
+				
+				// TODO: Do this on the row didLoad method
+				// Set tap recognizer
+				//let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(openActivity(_:)))
+				//row.isUserInteractionEnabled = true
+				//row.addGestureRecognizer(tapRecognizer)
+				
+				
+				
+			}
+		} catch {
+			NSLog(":ACTIVITIES:ERROR: Error with request: \(error)")
+		}
+		NSLog(":ACTIVITIES:DEBUG: Finished loading ActivitiesView")
+	}
+	
+	/*func openActivity(){//(_ sender:UITapGestureRecognizer? = nil){
+		NSLog(":ACTIVITIES:DEBUG: getting delegate and showing activity.")
+		let delegate: AppDelegate = UIApplication.shared.delegate as! AppDelegate
+		delegate.controller?.showActivity(id: 4)
+		NSLog(":ACTIVITIES:DEBUG: Activity should be shown.")
+	}
+	
+	func openActivity(_ sender:UITapGestureRecognizer? = nil){
+		NSLog(":ACTIVITIES:DEBUG: getting delegate and showing activity.")
+		let delegate: AppDelegate = UIApplication.shared.delegate as! AppDelegate
+		delegate.controller?.showActivity(id: 4)
+		NSLog(":ACTIVITIES:DEBUG: Activity should be shown.")
+	}*/
+	
+	func getLanguage() -> String{
+		let pre = NSLocale.preferredLanguages[0].subStr(start: 0, end: 1)
+		if(pre == "es" || pre == "en" || pre == "eu"){
+			return pre
+		}
+		else{
+			return "es"
+		}
+	}
+}

+ 60 - 0
app/ActivitiesView.xib

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ActivitiesView" customModule="app">
+            <connections>
+                <outlet property="container" destination="iN0-l3-epB" id="7AX-8i-BPU"/>
+                <outlet property="futureSection" destination="Jdf-74-tJS" id="WNV-uv-XXg"/>
+                <outlet property="pastSection" destination="0Su-Ex-4hq" id="3vd-uB-fTu"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB">
+            <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xyM-cc-W1r">
+                    <rect key="frame" x="0.0" y="0.0" width="375" height="666"/>
+                    <subviews>
+                        <stackView opaque="NO" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="gvi-ij-s5Q">
+                            <rect key="frame" x="0.0" y="0.0" width="375" height="306"/>
+                            <subviews>
+                                <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Jdf-74-tJS" customClass="Section" customModule="app">
+                                    <rect key="frame" x="0.0" y="0.0" width="375" height="50"/>
+                                </view>
+                                <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="0Su-Ex-4hq" customClass="Section" customModule="app">
+                                    <rect key="frame" x="0.0" y="50" width="375" height="256"/>
+                                </view>
+                            </subviews>
+                            <constraints>
+                                <constraint firstItem="0Su-Ex-4hq" firstAttribute="top" secondItem="Jdf-74-tJS" secondAttribute="bottom" constant="10" id="Vwq-bc-l9J"/>
+                                <constraint firstAttribute="bottom" secondItem="0Su-Ex-4hq" secondAttribute="bottom" id="YXW-7I-LlA"/>
+                            </constraints>
+                        </stackView>
+                    </subviews>
+                    <constraints>
+                        <constraint firstAttribute="bottom" secondItem="gvi-ij-s5Q" secondAttribute="bottom" id="dLo-VU-AFT"/>
+                        <constraint firstAttribute="trailing" secondItem="gvi-ij-s5Q" secondAttribute="trailing" id="iKv-jf-8lN"/>
+                        <constraint firstItem="gvi-ij-s5Q" firstAttribute="top" secondItem="xyM-cc-W1r" secondAttribute="top" id="nBi-D9-aFk"/>
+                    </constraints>
+                </scrollView>
+            </subviews>
+            <constraints>
+                <constraint firstItem="gvi-ij-s5Q" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" id="4bi-AV-eh4"/>
+                <constraint firstItem="xyM-cc-W1r" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" id="6Qm-1G-beA"/>
+                <constraint firstItem="xyM-cc-W1r" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="92C-lK-w4Q"/>
+                <constraint firstItem="gvi-ij-s5Q" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="Iab-hX-fdC"/>
+                <constraint firstItem="xyM-cc-W1r" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="iKU-OG-Vpz"/>
+                <constraint firstItem="xyM-cc-W1r" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="q5m-cP-yKY"/>
+            </constraints>
+        </view>
+    </objects>
+</document>

+ 9 - 9
app/Base.lproj/Main.storyboard

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
     <device id="retina4_0" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
@@ -64,7 +64,7 @@
                                 </collectionViewFlowLayout>
                                 <cells>
                                     <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="cell" id="a4j-DF-epb" customClass="MenuCollectionViewCell" customModule="app" customModuleProvider="target">
-                                        <rect key="frame" x="0.0" y="-2.5" width="100" height="50"/>
+                                        <rect key="frame" x="0.0" y="-3" width="100" height="50"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
                                             <rect key="frame" x="0.0" y="0.0" width="100" height="50"/>
@@ -256,10 +256,10 @@
                         <viewControllerLayoutGuide type="top" id="OhA-Gv-fwb"/>
                         <viewControllerLayoutGuide type="bottom" id="3Yd-97-laW"/>
                     </layoutGuides>
-                    <view key="view" contentMode="scaleToFill" id="e8E-bp-zJI">
+                    <view key="view" contentMode="scaleToFill" id="e8E-bp-zJI" customClass="ActivitiesView" customModule="app" customModuleProvider="target">
                         <rect key="frame" x="0.0" y="0.0" width="320" height="458"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <color key="backgroundColor" red="0.4079896717" green="1" blue="0.34807942549999998" alpha="1" colorSpace="calibratedRGB"/>
+                        <color key="backgroundColor" red="0.70980392156862748" green="0.82745098039215681" blue="0.89803921568627454" alpha="1" colorSpace="calibratedRGB"/>
                     </view>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="iuX-Se-nlc" userLabel="First Responder" sceneMemberID="firstResponder"/>
@@ -325,7 +325,7 @@
                                         </state>
                                     </button>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Gasteizko Margolariak" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BIE-D1-hCZ">
-                                        <rect key="frame" x="48" y="-0.5" width="224" height="30"/>
+                                        <rect key="frame" x="48" y="0.0" width="224" height="30"/>
                                         <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
                                         <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                         <nil key="highlightedColor"/>
@@ -703,10 +703,10 @@
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Logo" translatesAutoresizingMaskIntoConstraints="NO" id="dxh-Z0-luU">
-                                <rect key="frame" x="48" y="242.5" width="224" height="83"/>
+                                <rect key="frame" x="48" y="243" width="224" height="83"/>
                             </imageView>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Sincronizando..." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="up0-1V-tTd">
-                                <rect key="frame" x="0.0" y="335.5" width="320" height="30"/>
+                                <rect key="frame" x="0.0" y="336" width="320" height="30"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="30" id="mIj-oN-tq7"/>
                                 </constraints>
@@ -715,10 +715,10 @@
                                 <nil key="highlightedColor"/>
                             </label>
                             <progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" progress="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="VkR-DT-y3S">
-                                <rect key="frame" x="48" y="375.5" width="224" height="2"/>
+                                <rect key="frame" x="48" y="376" width="224" height="2"/>
                             </progressView>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Message" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pgU-dx-MvQ">
-                                <rect key="frame" x="48" y="385.5" width="224" height="18"/>
+                                <rect key="frame" x="48" y="386" width="224" height="18"/>
                                 <fontDescription key="fontDescription" type="italicSystem" pointSize="15"/>
                                 <color key="textColor" red="0.31238102791878175" green="0.31238102791878175" blue="0.31238102791878175" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>

+ 197 - 0
app/RowFutureActivity.swift

@@ -0,0 +1,197 @@
+// Copyright (C) 2016 Inigo Valentin
+//
+// This file is part of the Gasteizko Margolariak IOS app.
+//
+// The Gasteizko Margolariak IOS app is free software: you can
+// redistribute it and/or modify it under the terms of the
+// GNU General Public License as published by the Free Software
+// Foundation, either version 3 of the License, or (at your
+// option) any later version.
+//
+// The Gasteizko Margolariak IOS app is distributed in the
+// hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+// Public License for more details.
+//
+// You should have received a copy of the GNU General Public
+// License along with the Gasteizko Margolariak IOS app.
+// If not, see <http://www.gnu.org/licenses/>.
+
+import Foundation
+import UIKit
+
+/**
+Extension of UIView to be formatted as sections.
+*/
+@IBDesignable class RowFutureActivity: UIView {
+	
+	//This view
+	var v: UIView!
+
+	// Outlets
+	@IBOutlet weak var container: UIView!
+	@IBOutlet weak var title: UILabel!
+	@IBOutlet weak var image: UIImageView!
+	@IBOutlet weak var descript: UILabel!
+	@IBOutlet weak var date: UILabel!
+	@IBOutlet weak var city: UILabel!
+	@IBOutlet weak var price: UILabel!
+	
+	/**
+	Default constructor
+	*/
+	required init?(coder aDecoder: NSCoder) {
+		super.init(coder: aDecoder)
+	}
+	
+	private func loadViewFromNib() {
+		let bundle = Bundle(for: type(of: self))
+		let nib = UINib(nibName: String(describing: type(of: self)), bundle: bundle)
+		nib.instantiate(withOwner: self, options: nil).first as! UIView
+	}
+	
+	/**
+	Default constructor.
+	:param: s Custom identifier
+	:param: i Custom identifier
+	*/
+	init(s: String, i: Int) {
+		super.init(frame: CGRect(x: 0, y: 0, width: 0, height: 0))
+		loadViewFromNib()
+		v = self
+		self.frame = self.bounds
+		self.autoresizingMask = [.flexibleWidth, .flexibleHeight]
+		self.translatesAutoresizingMaskIntoConstraints = true
+		container.autoresizingMask = [.flexibleWidth, .flexibleHeight]
+		container.translatesAutoresizingMaskIntoConstraints = true
+		
+		container.frame = self.bounds
+		self.addSubview(container)
+		
+		// Set tap recognizer
+		/*print("ROW_FUTURE_ACTIVITY:DEBUG: set tap recognizer")
+		let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector (self.openActivity (_:)))
+		tapRecognizer.delegate = (UIApplication.shared.delegate as! AppDelegate).controller
+		addGestureRecognizer(tapRecognizer)*/
+	}
+	
+	/**
+	Default constructor for the interface builder
+	*/
+	override init(frame: CGRect){
+		super.init(frame: frame)
+	}
+	
+	
+	
+	/**
+	Changes the title of the activity. Decodes HTML.
+	:param: text The new title.
+	*/
+	func setTitle(text: String){
+		self.title.text = text.stripHtml()
+	}
+	
+	/**
+	Sets the city of the activity.
+	:param: text The city.
+	*/
+	func setCity(text: String){
+		self.city.text = text
+	}
+	
+	/**
+	Sets the price of the activity.
+	:param: price The price, in Euros. If 0, nothing is shown.
+	*/
+	func setPrice(price: Int){
+		if price != 0{
+			self.price.text = "\(price) €"
+		}
+		else{
+			self.price.text = ""
+		}
+	}
+	
+	/**
+	Changes the description of the activity. Decodes HTML.
+	:param: text The new text.
+	*/
+	func setText(text: String){
+		self.descript.text = text.stripHtml()
+	}
+	
+	/**
+	Sets the date of the activity in a human readable format.
+	:param: text The date.
+	:param: lang Device language.
+	*/
+	func setDate(date: NSDate, lang: String){
+		
+		let dateformatter = DateFormatter()
+		
+		let months_es = ["0index", "enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"]
+		let months_en = ["0index", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
+		let months_eu = ["0index", "urtarrilaren", "otsailaren", "martxoaren", "abrilaren", "maiatzaren", "ekainaren", "ustailaren", "abustuaren", "irailaren", "urriaren", "azaroaren", "abenduaren"]
+		let days_es = ["0index", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sábado", "Domingo"]
+		let days_en = ["0index", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
+		let days_eu = ["0index", "Astelehena", "Asteartea", "Asteazkena", "Osteguna", "Ostirala", "Larumbata", "Igandea"]
+		
+		let calendar = Calendar.current
+		let day = calendar.component(.day, from: date as Date)
+		let month = calendar.component(.month, from: date as Date)
+		let weekday = calendar.component(.weekday, from: date as Date)
+		var strDate = ""
+		
+		switch lang{
+			case "en":
+				
+				var dayNum = ""
+				switch day{
+					case 1:
+						dayNum = "1th"
+						break
+					case 2:
+						dayNum = "2nd"
+						break;
+					case 3:
+						dayNum = "3rd"
+						break;
+					default:
+						dayNum = "\(weekday)th"
+				}
+				
+				strDate = "\(days_en[weekday]), \(months_en[month]) \(dayNum)"
+				break
+			case "eu":
+				strDate = "\(days_eu[weekday]) \(months_eu[month]) \(day)an"
+				break
+			default:
+				strDate = "\(days_es[weekday]) \(day) de \(months_es[month])"
+		}
+		
+		self.date.text = strDate
+	}
+	
+	/**
+	Changes the image of the activity.
+	If null or empty, the igage is hidden.
+	:param: path The new text.
+	*/
+	func setImage(filename: String){
+		if (filename == ""){
+			NSLog("ROW_FUTURE_ACTIVITY:DEBUG: No image")
+			//TODO hide the imageview
+		}
+		else{
+			NSLog(":ROW_FUTURE_ACTIVITY:DEBUG: Set image \(filename)")
+			let path = "img/actividades/thumb/\(filename)"
+			image.setImage(localPath: path, remotePath: "https://margolariak.com/\(path)")
+		}
+	}
+	
+	func openActivity(_ sender:UITapGestureRecognizer? = nil){
+		NSLog(":ROW_FUTURE_ACTIVITY:DEBUG: open activity")
+	}
+}

+ 135 - 0
app/RowFutureActivity.xib

@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
+        <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="RowFutureActivity" customModule="app">
+            <connections>
+                <outlet property="city" destination="VQF-xA-wca" id="evN-BP-6An"/>
+                <outlet property="container" destination="LXM-17-fy1" id="4qg-I3-wo0"/>
+                <outlet property="date" destination="pCj-dq-5rF" id="4Cg-kn-D3p"/>
+                <outlet property="descript" destination="m6I-vy-k36" id="9rq-LM-8kb"/>
+                <outlet property="image" destination="xIf-kY-gPW" id="Kzl-DN-26C"/>
+                <outlet property="price" destination="U3K-kD-4pK" id="aV5-sa-dbD"/>
+                <outlet property="title" destination="Vd3-c0-iYd" id="jnK-lJ-Fav"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB">
+            <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LXM-17-fy1" userLabel="Container">
+                    <rect key="frame" x="0.0" y="263.5" width="375" height="140"/>
+                    <subviews>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Oax-mA-mEd" userLabel="Entry">
+                            <rect key="frame" x="10" y="10" width="355" height="140"/>
+                            <subviews>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Vd3-c0-iYd" userLabel="Title">
+                                    <rect key="frame" x="10" y="10" width="335" height="22"/>
+                                    <fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
+                                    <color key="textColor" red="0.1529411765" green="0.33333333329999998" blue="0.45098039220000002" alpha="1" colorSpace="calibratedRGB"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pCj-dq-5rF" userLabel="Date">
+                                    <rect key="frame" x="14.5" y="32" width="325" height="21"/>
+                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                    <color key="textColor" red="0.15294117647058825" green="0.33333333333333331" blue="0.45098039215686275" alpha="1" colorSpace="calibratedRGB"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                                <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="PhotoPlaceholder" translatesAutoresizingMaskIntoConstraints="NO" id="xIf-kY-gPW" userLabel="Image">
+                                    <rect key="frame" x="10" y="53" width="71" height="64"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="64" id="GGt-lC-syI"/>
+                                    </constraints>
+                                </imageView>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="m6I-vy-k36" userLabel="Text">
+                                    <rect key="frame" x="97" y="53" width="248" height="21"/>
+                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                    <nil key="textColor"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VQF-xA-wca" userLabel="City">
+                                    <rect key="frame" x="20" y="119" width="275" height="21"/>
+                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                    <color key="textColor" red="0.1529411765" green="0.33333333329999998" blue="0.45098039220000002" alpha="1" colorSpace="calibratedRGB"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="U3K-kD-4pK" userLabel="Price">
+                                    <rect key="frame" x="285" y="119" width="50" height="21"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="50" id="uI7-D4-q0g"/>
+                                    </constraints>
+                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                    <color key="textColor" red="0.1529411765" green="0.33333333329999998" blue="0.45098039220000002" alpha="1" colorSpace="calibratedRGB"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                            </subviews>
+                            <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+                            <constraints>
+                                <constraint firstItem="VQF-xA-wca" firstAttribute="width" secondItem="Oax-mA-mEd" secondAttribute="width" constant="-80" id="1bi-lD-f66"/>
+                                <constraint firstItem="pCj-dq-5rF" firstAttribute="top" secondItem="Vd3-c0-iYd" secondAttribute="bottom" id="2SS-dr-xRe"/>
+                                <constraint firstItem="Vd3-c0-iYd" firstAttribute="top" secondItem="Oax-mA-mEd" secondAttribute="top" constant="10" id="6ON-9I-XV5"/>
+                                <constraint firstItem="xIf-kY-gPW" firstAttribute="width" secondItem="Oax-mA-mEd" secondAttribute="width" multiplier="0.2" id="7yL-vu-0hi"/>
+                                <constraint firstItem="m6I-vy-k36" firstAttribute="width" secondItem="Oax-mA-mEd" secondAttribute="width" multiplier="0.7" id="G5a-55-w2d"/>
+                                <constraint firstItem="Vd3-c0-iYd" firstAttribute="leading" secondItem="Oax-mA-mEd" secondAttribute="leading" constant="10" id="Igf-ZR-anh"/>
+                                <constraint firstItem="pCj-dq-5rF" firstAttribute="centerX" secondItem="Oax-mA-mEd" secondAttribute="centerX" id="LiY-tJ-HN8"/>
+                                <constraint firstAttribute="trailing" secondItem="Vd3-c0-iYd" secondAttribute="trailing" constant="10" id="QqW-8x-l8D"/>
+                                <constraint firstAttribute="trailing" secondItem="m6I-vy-k36" secondAttribute="trailing" constant="10" id="d6m-wH-hZ4"/>
+                                <constraint firstItem="pCj-dq-5rF" firstAttribute="width" secondItem="Oax-mA-mEd" secondAttribute="width" constant="-30" id="ec5-Em-Hvc"/>
+                                <constraint firstItem="VQF-xA-wca" firstAttribute="leading" secondItem="Oax-mA-mEd" secondAttribute="leading" constant="20" id="fKa-XB-zgY"/>
+                                <constraint firstAttribute="trailing" secondItem="U3K-kD-4pK" secondAttribute="trailing" constant="20" id="fib-sq-y5t"/>
+                                <constraint firstItem="U3K-kD-4pK" firstAttribute="centerY" secondItem="VQF-xA-wca" secondAttribute="centerY" id="fxM-45-fab"/>
+                                <constraint firstItem="m6I-vy-k36" firstAttribute="top" secondItem="pCj-dq-5rF" secondAttribute="bottom" id="jKd-mD-fFn"/>
+                                <constraint firstAttribute="bottom" secondItem="VQF-xA-wca" secondAttribute="bottom" id="rUq-Gl-Ma0"/>
+                                <constraint firstItem="xIf-kY-gPW" firstAttribute="leading" secondItem="Oax-mA-mEd" secondAttribute="leading" constant="10" id="xRs-gP-CBO"/>
+                                <constraint firstItem="xIf-kY-gPW" firstAttribute="top" secondItem="pCj-dq-5rF" secondAttribute="bottom" id="xYq-wH-6dd"/>
+                            </constraints>
+                            <edgeInsets key="layoutMargins" top="8" left="8" bottom="8" right="8"/>
+                            <userDefinedRuntimeAttributes>
+                                <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
+                                    <color key="value" red="0.42745098040000001" green="0.41176470590000003" blue="0.56470588239999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </userDefinedRuntimeAttribute>
+                                <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                                    <real key="value" value="1"/>
+                                </userDefinedRuntimeAttribute>
+                                <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                    <real key="value" value="3"/>
+                                </userDefinedRuntimeAttribute>
+                            </userDefinedRuntimeAttributes>
+                        </view>
+                    </subviews>
+                    <constraints>
+                        <constraint firstItem="Oax-mA-mEd" firstAttribute="leading" secondItem="LXM-17-fy1" secondAttribute="leading" constant="10" id="1DE-sl-oYv"/>
+                        <constraint firstItem="Oax-mA-mEd" firstAttribute="bottom" secondItem="LXM-17-fy1" secondAttribute="bottom" constant="10" id="cGe-u0-Et9"/>
+                        <constraint firstAttribute="top" secondItem="Oax-mA-mEd" secondAttribute="top" constant="-10" id="dfL-CJ-4Ja"/>
+                        <constraint firstAttribute="trailing" secondItem="Oax-mA-mEd" secondAttribute="trailing" constant="10" id="mgX-om-hx4"/>
+                        <constraint firstAttribute="height" constant="140" id="pnJ-Mv-tz4"/>
+                    </constraints>
+                    <edgeInsets key="layoutMargins" top="8" left="8" bottom="8" right="8"/>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                            <real key="value" value="0.0"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                </view>
+            </subviews>
+            <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+            <constraints>
+                <constraint firstItem="LXM-17-fy1" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="GTl-bf-vFg"/>
+                <constraint firstItem="LXM-17-fy1" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" id="TQ0-Rk-U3O"/>
+                <constraint firstItem="LXM-17-fy1" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="l7x-fz-B1I"/>
+            </constraints>
+        </view>
+    </objects>
+    <resources>
+        <image name="PhotoPlaceholder" width="170" height="108"/>
+    </resources>
+</document>

+ 83 - 0
app/RowLabel.swift

@@ -0,0 +1,83 @@
+// Copyright (C) 2016 Inigo Valentin
+//
+// This file is part of the Gasteizko Margolariak IOS app.
+//
+// The Gasteizko Margolariak IOS app is free software: you can
+// redistribute it and/or modify it under the terms of the
+// GNU General Public License as published by the Free Software
+// Foundation, either version 3 of the License, or (at your
+// option) any later version.
+//
+// The Gasteizko Margolariak IOS app is distributed in the
+// hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+// Public License for more details.
+//
+// You should have received a copy of the GNU General Public
+// License along with the Gasteizko Margolariak IOS app.
+// If not, see <http://www.gnu.org/licenses/>.
+
+import Foundation
+import UIKit
+
+/**
+Extension of UIView to be formatted as sections.
+*/
+@IBDesignable class RowLabel: UIView {
+	
+	//This view
+	var v: UIView!
+	
+	// Outlets
+	@IBOutlet weak var container: UIView!
+	@IBOutlet weak var text: UILabel!
+	
+	/**
+	Default constructor
+	*/
+	required init?(coder aDecoder: NSCoder) {
+		super.init(coder: aDecoder)
+	}
+	
+	private func loadViewFromNib() {
+		let bundle = Bundle(for: type(of: self))
+		let nib = UINib(nibName: String(describing: type(of: self)), bundle: bundle)
+		nib.instantiate(withOwner: self, options: nil).first as! UIView
+	}
+	
+	/**
+	Default constructor.
+	:param: s Custom identifier
+	:param: i Custom identifier
+	*/
+	init(s: String, i: Int) {
+		super.init(frame: CGRect(x: 0, y: 0, width: 0, height: 0))
+		loadViewFromNib()
+		v = self
+		self.frame = self.bounds
+		self.autoresizingMask = [.flexibleWidth, .flexibleHeight]
+		self.translatesAutoresizingMaskIntoConstraints = true
+		container.autoresizingMask = [.flexibleWidth, .flexibleHeight]
+		container.translatesAutoresizingMaskIntoConstraints = true
+		
+		container.frame = self.bounds
+		self.addSubview(container)
+	}
+	
+	/**
+	Default constructor for the interface builder
+	*/
+	override init(frame: CGRect){
+		super.init(frame: frame)
+	}
+
+	
+	/**
+	Changes the text of The label. Decodes HTML.
+	:param: text The new text.
+	*/
+	func setText(text: String){
+		self.text.text = text.stripHtml()
+	}
+}

+ 79 - 0
app/RowLabel.xib

@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="RowLabel" customModule="app">
+            <connections>
+                <outlet property="container" destination="sWl-jd-g1w" id="uN3-0d-wln"/>
+                <outlet property="text" destination="cAu-3X-Tbx" id="J1F-St-t3M"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB">
+            <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="sWl-jd-g1w" userLabel="Container">
+                    <rect key="frame" x="0.0" y="313.5" width="375" height="40.5"/>
+                    <subviews>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9wy-u8-pKj" userLabel="Entry">
+                            <rect key="frame" x="10" y="10" width="355" height="40.5"/>
+                            <subviews>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="cAu-3X-Tbx" userLabel="Text">
+                                    <rect key="frame" x="10" y="10" width="335" height="20.5"/>
+                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                    <nil key="textColor"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                            </subviews>
+                            <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+                            <constraints>
+                                <constraint firstItem="cAu-3X-Tbx" firstAttribute="width" secondItem="9wy-u8-pKj" secondAttribute="width" constant="-20" id="8vk-yq-iYR"/>
+                                <constraint firstItem="cAu-3X-Tbx" firstAttribute="centerY" secondItem="9wy-u8-pKj" secondAttribute="centerY" id="gGp-W9-8FT"/>
+                                <constraint firstItem="cAu-3X-Tbx" firstAttribute="height" secondItem="9wy-u8-pKj" secondAttribute="height" constant="-20" id="if1-Pg-hNH"/>
+                                <constraint firstItem="cAu-3X-Tbx" firstAttribute="centerX" secondItem="9wy-u8-pKj" secondAttribute="centerX" id="mED-iI-aHq"/>
+                            </constraints>
+                            <edgeInsets key="layoutMargins" top="8" left="8" bottom="8" right="8"/>
+                            <userDefinedRuntimeAttributes>
+                                <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
+                                    <color key="value" red="0.42745098040000001" green="0.41176470590000003" blue="0.56470588239999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </userDefinedRuntimeAttribute>
+                                <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                                    <real key="value" value="1"/>
+                                </userDefinedRuntimeAttribute>
+                                <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                    <real key="value" value="3"/>
+                                </userDefinedRuntimeAttribute>
+                            </userDefinedRuntimeAttributes>
+                        </view>
+                    </subviews>
+                    <constraints>
+                        <constraint firstAttribute="top" secondItem="9wy-u8-pKj" secondAttribute="top" constant="-10" id="E6z-L4-kxl"/>
+                        <constraint firstItem="9wy-u8-pKj" firstAttribute="bottom" secondItem="sWl-jd-g1w" secondAttribute="bottom" constant="10" id="mr3-wn-Fhg"/>
+                        <constraint firstAttribute="trailing" secondItem="9wy-u8-pKj" secondAttribute="trailing" constant="10" id="qfZ-sB-04Y"/>
+                        <constraint firstItem="9wy-u8-pKj" firstAttribute="leading" secondItem="sWl-jd-g1w" secondAttribute="leading" constant="10" id="wlF-xl-Kb8"/>
+                    </constraints>
+                    <edgeInsets key="layoutMargins" top="8" left="8" bottom="8" right="8"/>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                            <real key="value" value="0.0"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                </view>
+            </subviews>
+            <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+            <constraints>
+                <constraint firstItem="sWl-jd-g1w" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="i65-Nb-Seg"/>
+                <constraint firstItem="sWl-jd-g1w" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="q8B-3g-WjE"/>
+                <constraint firstItem="sWl-jd-g1w" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" id="z0m-TJ-Jig"/>
+            </constraints>
+        </view>
+    </objects>
+</document>

+ 121 - 0
app/RowPastActivity.swift

@@ -0,0 +1,121 @@
+// Copyright (C) 2016 Inigo Valentin
+//
+// This file is part of the Gasteizko Margolariak IOS app.
+//
+// The Gasteizko Margolariak IOS app is free software: you can
+// redistribute it and/or modify it under the terms of the
+// GNU General Public License as published by the Free Software
+// Foundation, either version 3 of the License, or (at your
+// option) any later version.
+//
+// The Gasteizko Margolariak IOS app is distributed in the
+// hope that it will be useful, but WITHOUT ANY WARRANTY;
+// without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+// Public License for more details.
+//
+// You should have received a copy of the GNU General Public
+// License along with the Gasteizko Margolariak IOS app.
+// If not, see <http://www.gnu.org/licenses/>.
+
+import Foundation
+import UIKit
+
+/**
+Extension of UIView to be formatted as sections.
+*/
+@IBDesignable class RowPastActivity: UIView {
+	
+	//This view
+	var v: UIView!
+	
+	// Outlets
+	@IBOutlet weak var container: UIView!
+	@IBOutlet weak var title: UILabel!
+	@IBOutlet weak var image: UIImageView!
+	@IBOutlet weak var descript: UILabel!
+	
+	/**
+	Default constructor
+	*/
+	required init?(coder aDecoder: NSCoder) {
+		super.init(coder: aDecoder)
+	}
+	
+	private func loadViewFromNib() {
+		let bundle = Bundle(for: type(of: self))
+		let nib = UINib(nibName: String(describing: type(of: self)), bundle: bundle)
+		nib.instantiate(withOwner: self, options: nil).first as! UIView
+	}
+	
+	/**
+	Default constructor.
+	:param: s Custom identifier
+	:param: i Custom identifier
+	*/
+	init(s: String, i: Int) {
+		super.init(frame: CGRect(x: 0, y: 0, width: 0, height: 0))
+		loadViewFromNib()
+		v = self
+		self.frame = self.bounds
+		self.autoresizingMask = [.flexibleWidth, .flexibleHeight]
+		self.translatesAutoresizingMaskIntoConstraints = true
+		container.autoresizingMask = [.flexibleWidth, .flexibleHeight]
+		container.translatesAutoresizingMaskIntoConstraints = true
+		
+		container.frame = self.bounds
+		self.addSubview(container)
+		
+		// Set tap recognizer
+		/*print("ROW_PAST_ACTIVITY:DEBUG: set tap recognizer")
+		let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector (self.openActivity (_:)))
+		tapRecognizer.delegate = (UIApplication.shared.delegate as! AppDelegate).controller
+		addGestureRecognizer(tapRecognizer)*/
+	}
+	
+	/**
+	Default constructor for the interface builder
+	*/
+	override init(frame: CGRect){
+		super.init(frame: frame)
+	}
+	
+	
+	
+	/**
+	Changes the title of the activity. Decodes HTML.
+	:param: text The new title.
+	*/
+	func setTitle(text: String){
+		title.text = text.stripHtml()
+	}
+	
+	/**
+	Changes the description of the activity. Decodes HTML.
+	:param: text The new text.
+	*/
+	func setText(text: String){
+		descript.text = text.stripHtml()
+	}
+	
+	/**
+	Changes the image of the activity.
+	If null or empty, the igage is hidden.
+	:param: path The new text.
+	*/
+	func setImage(filename: String){
+		if (filename == ""){
+			NSLog("ROW_PAST_ACTIVITY:DEBUG: No image")
+			//TODO hide the imageview
+		}
+		else{
+			NSLog(":ROW_PAST_ACTIVITY:DEBUG: Set image \(filename)")
+			let path = "img/actividades/thumb/\(filename)"
+			image.setImage(localPath: path, remotePath: "https://margolariak.com/\(path)")
+		}
+	}
+	
+	func openActivity(_ sender:UITapGestureRecognizer? = nil){
+		NSLog(":ROW_PAST_ACTIVITY:DEBUG: open activity")
+	}
+}

+ 103 - 0
app/RowPastActivity.xib

@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11762" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
+        <capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="RowPastActivity" customModule="app">
+            <connections>
+                <outlet property="container" destination="0f3-n8-snP" id="8j2-8w-POc"/>
+                <outlet property="descript" destination="LX0-An-ebo" id="z3b-XC-PGL"/>
+                <outlet property="image" destination="dtJ-G2-LyM" id="XkE-dY-Uil"/>
+                <outlet property="title" destination="5y2-jo-1Ha" id="Axu-Cg-JJ5"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB">
+            <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0f3-n8-snP" userLabel="Container">
+                    <rect key="frame" x="0.0" y="273.5" width="375" height="120"/>
+                    <subviews>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="m2C-OM-hgM" userLabel="Entry">
+                            <rect key="frame" x="10" y="10" width="355" height="120"/>
+                            <subviews>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5y2-jo-1Ha" userLabel="Title">
+                                    <rect key="frame" x="10" y="10" width="335" height="22"/>
+                                    <fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
+                                    <color key="textColor" red="0.1529411765" green="0.33333333329999998" blue="0.45098039220000002" alpha="1" colorSpace="calibratedRGB"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                                <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="PhotoPlaceholder" translatesAutoresizingMaskIntoConstraints="NO" id="dtJ-G2-LyM" userLabel="Image">
+                                    <rect key="frame" x="10" y="40" width="71" height="64"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="64" id="5JB-2b-om6"/>
+                                    </constraints>
+                                </imageView>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LX0-An-ebo" userLabel="Text">
+                                    <rect key="frame" x="97" y="40" width="248" height="21"/>
+                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                    <nil key="textColor"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                            </subviews>
+                            <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+                            <constraints>
+                                <constraint firstItem="5y2-jo-1Ha" firstAttribute="leading" secondItem="m2C-OM-hgM" secondAttribute="leading" constant="10" id="5t3-5D-Bw9"/>
+                                <constraint firstAttribute="trailing" secondItem="5y2-jo-1Ha" secondAttribute="trailing" constant="10" id="8e4-5r-Akk"/>
+                                <constraint firstItem="dtJ-G2-LyM" firstAttribute="width" secondItem="m2C-OM-hgM" secondAttribute="width" multiplier="0.2" id="GYq-dz-9OC"/>
+                                <constraint firstAttribute="trailing" secondItem="LX0-An-ebo" secondAttribute="trailing" constant="10" id="STs-WD-4SU"/>
+                                <constraint firstItem="dtJ-G2-LyM" firstAttribute="leading" secondItem="m2C-OM-hgM" secondAttribute="leading" constant="10" id="UPa-J0-dqk"/>
+                                <constraint firstItem="LX0-An-ebo" firstAttribute="top" secondItem="m2C-OM-hgM" secondAttribute="top" constant="40" id="cuE-pv-oLu"/>
+                                <constraint firstItem="dtJ-G2-LyM" firstAttribute="top" secondItem="m2C-OM-hgM" secondAttribute="top" constant="40" id="ed0-bE-O9g"/>
+                                <constraint firstItem="5y2-jo-1Ha" firstAttribute="top" secondItem="m2C-OM-hgM" secondAttribute="top" constant="10" id="nZ9-2T-9r8"/>
+                                <constraint firstItem="LX0-An-ebo" firstAttribute="width" secondItem="m2C-OM-hgM" secondAttribute="width" multiplier="0.7" id="yaA-lG-dUP"/>
+                            </constraints>
+                            <edgeInsets key="layoutMargins" top="8" left="8" bottom="8" right="8"/>
+                            <userDefinedRuntimeAttributes>
+                                <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
+                                    <color key="value" red="0.42745098040000001" green="0.41176470590000003" blue="0.56470588239999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </userDefinedRuntimeAttribute>
+                                <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                                    <real key="value" value="1"/>
+                                </userDefinedRuntimeAttribute>
+                                <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                    <real key="value" value="3"/>
+                                </userDefinedRuntimeAttribute>
+                            </userDefinedRuntimeAttributes>
+                        </view>
+                    </subviews>
+                    <constraints>
+                        <constraint firstAttribute="trailing" secondItem="m2C-OM-hgM" secondAttribute="trailing" constant="10" id="1dr-q7-OCF"/>
+                        <constraint firstAttribute="top" secondItem="m2C-OM-hgM" secondAttribute="top" constant="-10" id="2wX-Nf-cYh"/>
+                        <constraint firstAttribute="height" constant="120" id="Btv-5Q-hKb"/>
+                        <constraint firstItem="m2C-OM-hgM" firstAttribute="bottom" secondItem="0f3-n8-snP" secondAttribute="bottom" constant="10" id="lgl-YA-QZP"/>
+                        <constraint firstItem="m2C-OM-hgM" firstAttribute="leading" secondItem="0f3-n8-snP" secondAttribute="leading" constant="10" id="zBz-05-y7c"/>
+                    </constraints>
+                    <edgeInsets key="layoutMargins" top="8" left="8" bottom="8" right="8"/>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                            <real key="value" value="0.0"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                </view>
+            </subviews>
+            <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+            <constraints>
+                <constraint firstItem="0f3-n8-snP" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" id="9st-8M-YFq"/>
+                <constraint firstItem="0f3-n8-snP" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="cwD-TG-T2H"/>
+                <constraint firstItem="0f3-n8-snP" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="iW1-1C-Wc1"/>
+            </constraints>
+        </view>
+    </objects>
+    <resources>
+        <image name="PhotoPlaceholder" width="170" height="108"/>
+    </resources>
+</document>

+ 1 - 1
app/ViewController.swift

@@ -37,7 +37,7 @@ class ViewController: UIViewController, UICollectionViewDataSource, UICollection
 	//Each of the sections of the app.
 	@IBOutlet var containerViewGallery: GalleryView!
 	@IBOutlet var containerViewBlog: BlogView!
-	@IBOutlet var containerViewActivities: UIView!
+	@IBOutlet var containerViewActivities: ActivitiesView!
 	@IBOutlet var containerViewLablanca: LablancaView!
 	@IBOutlet var containerViewLocation: UIView!
 	@IBOutlet var containerViewHome: HomeView!