Browse Source

Add edit link for location

Alan Lam 8 years ago
parent
commit
c0485602ed
4 changed files with 19 additions and 4 deletions
  1. 0 0
      public/css/bootstrap.min.css
  2. 2 0
      public/js/app-project-form.js
  3. 11 0
      scss/_main.scss
  4. 6 4
      views/project_form.php

File diff suppressed because it is too large
+ 0 - 0
public/css/bootstrap.min.css


+ 2 - 0
public/js/app-project-form.js

@@ -40,6 +40,8 @@ $(function() {
 		return true;
 	});
 
+	initialiseTooltips();
+
 });
 
 function handleSelectButton() {

+ 11 - 0
scss/_main.scss

@@ -106,4 +106,15 @@ input[required], select[required], textarea[required] {
 	background-image: url(/img/bg_required.png);
 	background-position: center right;
 	background-repeat: no-repeat;
+}
+
+.hover-container {
+	.visible-on-hover {
+		display: none;
+	}
+	&:hover {
+		.visible-on-hover {
+			display: initial;
+		}
+	}
 }

+ 6 - 4
views/project_form.php

@@ -227,11 +227,12 @@ $time_of_day_options = [
 						?>
 						<div class="list-group-item" data-location-id="<?=$location->id?>" data-internal-id="<?=htmlspecialchars($location->internal_id)?>" data-name="<?=htmlspecialchars($location->name)?>" data-filter-value="<?=htmlspecialchars($filter)?>">
 							<div class="row no-gutters">
-								<div class="col-2 text-right pr-3">
+								<div class="col-2 text-right">
 									<?=$location->id?>
 								</div>
-								<div class="col">
+								<div class="col hover-container px-3">
 									<a href="/account/locations/<?=$location->id?>" target="_blank"><?=htmlspecialchars($location->name)?></a>
+									<a class="visible-on-hover float-right" href="/account/locations/<?=$location->id?>/edit" target="_blank"><i class="fal fa-pencil" data-toggle="tooltip" data-title="Edit"></i></a>
 									<?php
 									if($location->internal_id) {
 										?>
@@ -289,11 +290,12 @@ $time_of_day_options = [
 						?>
 						<div class="list-group-item" data-location-id="<?=$location->id?>" data-internal-id="<?=htmlspecialchars($location->internal_id)?>" data-name="<?=htmlspecialchars($location->name)?>" data-filter-value="<?=htmlspecialchars($filter)?>">
 							<div class="row no-gutters">
-								<div class="col-2 text-right pr-3">
+								<div class="col-2 text-right">
 									<?=$location->id?>
 								</div>
-								<div class="col">
+								<div class="col hover-container px-3">
 									<a href="/account/locations/<?=$location->id?>" target="_blank"><?=htmlspecialchars($location->name)?></a>
+									<a class="visible-on-hover float-right" href="/account/locations/<?=$location->id?>/edit" target="_blank"><i class="fal fa-pencil" data-toggle="tooltip" data-title="Edit"></i></a>
 									<?php
 									if($location->internal_id) {
 										?>

Some files were not shown because too many files changed in this diff