Add show recent commit logs in the about repository page
This commit is contained in:
parent
dde194ad3d
commit
48d1ab34d2
4 changed files with 91 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12106.1" systemVersion="16E154a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="YoR-iB-XAd">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12106.1" systemVersion="16E163f" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="YoR-iB-XAd">
|
||||
<device id="retina5_5" orientation="portrait">
|
||||
<adaptation id="fullscreen"/>
|
||||
</device>
|
||||
|
|
@ -239,6 +239,7 @@
|
|||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="Fgk-EG-6cx">
|
||||
<rect key="frame" x="0.0" y="0.0" width="1000" height="1000"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
|
|
@ -269,6 +270,50 @@
|
|||
</objects>
|
||||
<point key="canvasLocation" x="2390" y="3510"/>
|
||||
</scene>
|
||||
<!--Commit Logs Table View Controller-->
|
||||
<scene sceneID="pc3-11-f5B">
|
||||
<objects>
|
||||
<tableViewController id="Tou-Dd-HI3" customClass="CommitLogsTableViewController" customModule="pass" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="ZfX-el-epa">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<prototypes>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="commitLogCell" textLabel="F6l-ge-iaV" detailTextLabel="WA3-eC-AH9" style="IBUITableViewCellStyleValue1" id="OfB-1N-1Am">
|
||||
<rect key="frame" x="0.0" y="28" width="414" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="OfB-1N-1Am" id="fh0-au-C6q">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="43.666666666666664"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="F6l-ge-iaV">
|
||||
<rect key="frame" x="15" y="13" width="30" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="WA3-eC-AH9">
|
||||
<rect key="frame" x="359.66666666666669" y="13" width="39.333333333333336" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="15"/>
|
||||
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
</prototypes>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="Tou-Dd-HI3" id="e7Z-Ot-QFH"/>
|
||||
<outlet property="delegate" destination="Tou-Dd-HI3" id="uOc-cq-8aH"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
</tableViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dk5-pb-UNe" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="6305" y="1403"/>
|
||||
</scene>
|
||||
<!--Git Server-->
|
||||
<scene sceneID="Obl-ql-ILG">
|
||||
<objects>
|
||||
|
|
@ -688,6 +733,9 @@
|
|||
<outlet property="delegate" destination="RcF-UZ-Tde" id="cb8-q4-IKM"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
<connections>
|
||||
<segue destination="Tou-Dd-HI3" kind="show" identifier="showCommitLogsSegue" id="QDu-eG-DiD"/>
|
||||
</connections>
|
||||
</tableViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="2jy-oC-WQa" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
|
|
|
|||
|
|
@ -55,7 +55,8 @@ class AboutRepositoryTableViewController: BasicStaticTableViewController {
|
|||
[[.style: CellDataStyle.value1, .accessoryType: type, .title: "Passwords", .detailText: numberOfPasswords],
|
||||
[.style: CellDataStyle.value1, .accessoryType: type, .title: "Size", .detailText: sizeOfRepository], [.style: CellDataStyle.value1, .accessoryType: type, .title: "Unsynced", .detailText: String(PasswordStore.shared.getNumberOfUnsyncedPasswords())],
|
||||
[.style: CellDataStyle.value1, .accessoryType: type, .title: "Last Synced", .detailText: Utils.getLastUpdatedTimeString()],
|
||||
[.style: CellDataStyle.value1, .accessoryType: type, .title: "Commits", .detailText: numberOfCommitsString]
|
||||
[.style: CellDataStyle.value1, .accessoryType: type, .title: "Commits", .detailText: numberOfCommitsString],
|
||||
[.title: "Commit Logs", .action: "segue", .link: "showCommitLogsSegue"],
|
||||
],
|
||||
]
|
||||
indicator.stopAnimating()
|
||||
|
|
|
|||
36
pass/Controllers/CommitLogsTableViewController.swift
Normal file
36
pass/Controllers/CommitLogsTableViewController.swift
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
//
|
||||
// CommitLogsTableViewController.swift
|
||||
// pass
|
||||
//
|
||||
// Created by Mingshen Sun on 28/2/2017.
|
||||
// Copyright © 2017 Bob Sun. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import ObjectiveGit
|
||||
|
||||
class CommitLogsTableViewController: UITableViewController {
|
||||
var commits: [GTCommit] = []
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
commits = PasswordStore.shared.getRecentCommits(count: 20)
|
||||
navigationItem.title = "Recent Commit Logs"
|
||||
navigationItem.leftBarButtonItem?.title = "About"
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return commits.count
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "commitLogCell", for: indexPath)
|
||||
let formatter = DateFormatter()
|
||||
formatter.dateStyle = DateFormatter.Style.medium
|
||||
formatter.timeStyle = .medium
|
||||
let dateString = formatter.string(from: commits[indexPath.row].commitDate)
|
||||
cell.textLabel?.text = dateString
|
||||
cell.detailTextLabel?.text = commits[indexPath.row].message
|
||||
return cell
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue