git.iko.soy/dashared/hookah-tau
on develop help sign in
поправила экранчик просмотра/редактирования броньки админу
commit7f3d912b162f2d2f8737a82d86b50c0500061eef authorDarya Rednikina <rednikina.com@yandex.ru> dateSat 11 Jan 2020, 23:45 (7 years ago) parent1cb9a68
4 files changed+49−36
Hookah Tau/Controllers/Admin/Reservations/AdminReservationEditingViewController.swift+3−12 Hookah Tau/Controllers/Admin/Reservations/AdminReservations.storyboard+3−3 Hookah Tau/Controllers/Admin/Reservations/Views/AdminReservationView.swift+7 Hookah Tau/Controllers/Admin/Reservations/Views/AdminReservationView.xib+36−21
Hookah Tau/Controllers/Admin/Reservations/AdminReservationEditingViewController.swift+3−12
@@ -33,13 +33,6 @@ class AdminReservationEditingViewController: BaseViewController {
3333 setupReservationViewWithIntervals()
3434 }
3535 }
36−
37− var saveButton: Button = {
38− let button = Button()
39− let style = BlackButtonStyle()
40− style.apply(to: button, withTitle: "СОХРАНИТЬ")
41− return button
42− }()
4336
4437 // MARK:- Lifecycle
4538
@@ -64,10 +57,8 @@ class AdminReservationEditingViewController: BaseViewController {
6457 // MARK: - Setup
6558
6659 func setupButtons() {
67− addStackViewWithButtons(rightBtn: saveButton,
68− constant: -mainContentView.frame.height - 10)
6960
70− saveButton.addTarget(self, action: #selector(saveReservation), for: .touchUpInside)
61+ reservationView?.saveButton?.addTarget(self, action: #selector(saveReservation), for: .touchUpInside)
7162 reservationView?.cancelButton?.addTarget(self, action: #selector(cancelReservation), for: .touchUpInside)
7263 }
7364
@@ -122,7 +113,7 @@ class AdminReservationEditingViewController: BaseViewController {
122113 let uuid = reservationData?.uuid
123114 else { return }
124115
125− saveButton.loading = true
116+ reservationView?.saveButton?.loading = true
126117
127118 reservationService?.updateReservation(startTime: r.startTime,
128119 numberOfGuests: r.numberOfGuests,
@@ -136,7 +127,7 @@ class AdminReservationEditingViewController: BaseViewController {
136127 self?.displayAlert(with: "Что-то пошло не так! Попробуешь еще раз?")
137128 }
138129
139− self?.saveButton.loading = false
130+ self?.reservationView?.saveButton?.loading = false
140131 })
141132 }
142133
Hookah Tau/Controllers/Admin/Reservations/AdminReservations.storyboard+3−3
@@ -32,14 +32,14 @@
3232 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
3333 <subviews>
3434 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uNU-TW-vfq">
35− <rect key="frame" x="0.0" y="206" width="375" height="441"/>
35+ <rect key="frame" x="0.0" y="262" width="375" height="385"/>
3636 <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
3737 <constraints>
38− <constraint firstAttribute="height" constant="441" id="wfZ-i9-ruU"/>
38+ <constraint firstAttribute="height" constant="385" id="wfZ-i9-ruU"/>
3939 </constraints>
4040 </view>
4141 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ghQ-Jv-1Uo">
42− <rect key="frame" x="0.0" y="0.0" width="375" height="198"/>
42+ <rect key="frame" x="0.0" y="0.0" width="375" height="254"/>
4343 <color key="backgroundColor" systemColor="systemGreenColor" red="0.20392156859999999" green="0.78039215689999997" blue="0.34901960780000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
4444 </view>
4545 </subviews>
Hookah Tau/Controllers/Admin/Reservations/Views/AdminReservationView.swift+7
@@ -39,6 +39,13 @@ class AdminReservationView: UIView {
3939
4040 @IBOutlet weak var intervalsStackView: UIStackView!
4141
42+ @IBOutlet weak var saveButton: Button? {
43+ didSet {
44+ let style = BlackButtonStyle()
45+ style.apply(to: saveButton, withTitle: "СОХРАНИТЬ")
46+ }
47+ }
48+
4249 // MARK: - Properties
4350
4451 // констрейнты начала и конца интервала
Hookah Tau/Controllers/Admin/Reservations/Views/AdminReservationView.xib+36−21
@@ -11,14 +11,14 @@
1111 <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
1212 <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
1313 <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="AdminReservationView" customModule="Hookah_Tau" customModuleProvider="target">
14− <rect key="frame" x="0.0" y="0.0" width="414" height="441"/>
14+ <rect key="frame" x="0.0" y="0.0" width="414" height="385"/>
1515 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1616 <subviews>
17− <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" spacing="48" translatesAutoresizingMaskIntoConstraints="NO" id="AEf-R4-K1F">
18− <rect key="frame" x="0.0" y="16" width="414" height="404"/>
17+ <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" spacing="24" translatesAutoresizingMaskIntoConstraints="NO" id="AEf-R4-K1F">
18+ <rect key="frame" x="0.0" y="16" width="414" height="349"/>
1919 <subviews>
2020 <stackView opaque="NO" contentMode="scaleToFill" alignment="top" spacing="4" translatesAutoresizingMaskIntoConstraints="NO" id="oh7-ka-ctS">
21− <rect key="frame" x="21" y="0.0" width="372" height="143.5"/>
21+ <rect key="frame" x="21" y="0.0" width="372" height="136.5"/>
2222 <subviews>
2323 <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="top" spacing="22" translatesAutoresizingMaskIntoConstraints="NO" id="IY6-F4-aln">
2424 <rect key="frame" x="0.0" y="0.0" width="129" height="136.5"/>
@@ -66,21 +66,35 @@
6666 <constraint firstItem="hEV-kW-bBH" firstAttribute="leading" secondItem="IY6-F4-aln" secondAttribute="leading" id="tsb-PN-YGB"/>
6767 </constraints>
6868 </stackView>
69− <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="bottom" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="59c-nG-5Fh">
70− <rect key="frame" x="133" y="0.0" width="239" height="71.5"/>
69+ <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" alignment="bottom" spacing="28" translatesAutoresizingMaskIntoConstraints="NO" id="Kjb-P4-v2B">
70+ <rect key="frame" x="133" y="0.0" width="239" height="136.5"/>
7171 <subviews>
72− <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Стасик" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="OoG-F4-OVu">
73− <rect key="frame" x="160.5" y="0.0" width="78.5" height="26.5"/>
74− <fontDescription key="fontDescription" type="boldSystem" pointSize="22"/>
75− <nil key="textColor"/>
76− <nil key="highlightedColor"/>
77− </label>
78− <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Xkd-xQ-cFd" customClass="Button" customModule="Hookah_Tau" customModuleProvider="target">
79− <rect key="frame" x="65" y="34.5" width="174" height="37"/>
72+ <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="bottom" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="59c-nG-5Fh">
73+ <rect key="frame" x="65" y="0.0" width="174" height="71.5"/>
74+ <subviews>
75+ <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Стасик" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="OoG-F4-OVu">
76+ <rect key="frame" x="95.5" y="0.0" width="78.5" height="26.5"/>
77+ <fontDescription key="fontDescription" type="boldSystem" pointSize="22"/>
78+ <nil key="textColor"/>
79+ <nil key="highlightedColor"/>
80+ </label>
81+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Xkd-xQ-cFd" customClass="Button" customModule="Hookah_Tau" customModuleProvider="target">
82+ <rect key="frame" x="0.0" y="34.5" width="174" height="37"/>
83+ <color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
84+ <constraints>
85+ <constraint firstAttribute="height" constant="37" id="7Wj-WF-xzD"/>
86+ <constraint firstAttribute="width" constant="174" id="ZYo-ko-rwn"/>
87+ </constraints>
88+ <state key="normal" title="Button"/>
89+ </button>
90+ </subviews>
91+ </stackView>
92+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="npC-AF-3pj" customClass="Button" customModule="Hookah_Tau" customModuleProvider="target">
93+ <rect key="frame" x="103" y="99.5" width="136" height="37"/>
8094 <color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
8195 <constraints>
82− <constraint firstAttribute="height" constant="37" id="7Wj-WF-xzD"/>
83− <constraint firstAttribute="width" constant="174" id="ZYo-ko-rwn"/>
96+ <constraint firstAttribute="width" constant="136" id="jg5-lP-Ekd"/>
97+ <constraint firstAttribute="height" constant="37" id="w98-8a-pmH"/>
8498 </constraints>
8599 <state key="normal" title="Button"/>
86100 </button>
@@ -89,7 +103,7 @@
89103 </subviews>
90104 </stackView>
91105 <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="9RO-aK-yNh">
92− <rect key="frame" x="21" y="191.5" width="372" height="58.5"/>
106+ <rect key="frame" x="21" y="160.5" width="372" height="58.5"/>
93107 <subviews>
94108 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Количество гостей: 2" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yTM-U5-XjI">
95109 <rect key="frame" x="0.0" y="0.0" width="372" height="20.5"/>
@@ -106,7 +120,7 @@
106120 </subviews>
107121 </stackView>
108122 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vKS-ia-RxW">
109− <rect key="frame" x="0.0" y="298" width="414" height="106"/>
123+ <rect key="frame" x="0.0" y="243" width="414" height="106"/>
110124 <subviews>
111125 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="EiP-QO-PbU">
112126 <rect key="frame" x="0.0" y="20" width="414" height="85"/>
@@ -182,10 +196,10 @@
182196 </subviews>
183197 <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
184198 <constraints>
185− <constraint firstItem="vUN-kp-3ea" firstAttribute="bottom" secondItem="AEf-R4-K1F" secondAttribute="bottom" constant="21" id="4MN-Yl-hYv"/>
186199 <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="AEf-R4-K1F" secondAttribute="trailing" id="C1h-bA-S6p"/>
187200 <constraint firstItem="AEf-R4-K1F" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="H1o-ua-Tnn"/>
188− <constraint firstItem="vUN-kp-3ea" firstAttribute="top" secondItem="AEf-R4-K1F" secondAttribute="top" constant="-16" id="eYI-is-YLt"/>
201+ <constraint firstAttribute="top" secondItem="AEf-R4-K1F" secondAttribute="top" constant="-16" id="eYI-is-YLt"/>
202+ <constraint firstAttribute="bottom" secondItem="AEf-R4-K1F" secondAttribute="bottom" constant="20" id="fdG-zZ-LeV"/>
189203 </constraints>
190204 <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
191205 <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
@@ -198,11 +212,12 @@
198212 <outlet property="intervalsStackView" destination="bpJ-pe-tQf" id="aF0-Qm-kuh"/>
199213 <outlet property="nameLabel" destination="OoG-F4-OVu" id="rnW-fG-jFs"/>
200214 <outlet property="numberOfGuestLabel" destination="yTM-U5-XjI" id="z0O-94-Mp7"/>
215+ <outlet property="saveButton" destination="npC-AF-3pj" id="Rfm-Zl-zES"/>
201216 <outlet property="scrollView" destination="trF-VM-0qV" id="P5v-fg-hUW"/>
202217 <outlet property="tableLabel" destination="qNR-EO-oMK" id="63P-AS-fgf"/>
203218 <outlet property="timeLabel" destination="gau-aS-vtT" id="7Iy-Cz-zdY"/>
204219 </connections>
205− <point key="canvasLocation" x="137.59999999999999" y="120.98950524737631"/>
220+ <point key="canvasLocation" x="137.59999999999999" y="95.802098950524751"/>
206221 </view>
207222 </objects>
208223</document>