Last active
April 13, 2017 19:50
-
-
Save fabiangarga/c9ef545652607a16c4c7f10eaa8b35a4 to your computer and use it in GitHub Desktop.
Editview
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@model Talento.Models.EditCandidateViewModel | |
<div class="modal-dialog"> | |
<div class="modal-content"> | |
<div class="modal-body" id="edit-position-dialog-body"> | |
<form> | |
<input type="hidden" id="CandidateId" name="CandidateId" value="data-candidate-id"> | |
<div class="modal-body"> | |
<p><strong>Edit Profile</strong></p> | |
<div class="form-group row"> | |
<label for="Candidateemail" class="col-md-2 col-form-label">Email</label> | |
<div class="col-md-4"> | |
<input disabled class="form-control" type="text" id="CandidateEmail" value="@Model.Email"> | |
</div> | |
</div> | |
<div class="form-group row"> | |
<label for="CandidateName" class="col-md-2 col-form-label">Name</label> | |
<div class="col-md-4"> | |
<input class="form-control" type="text" id="CandidateName" name="Name" value="@Model.Name"> | |
</div> | |
</div> | |
<div class="form-group row"> | |
<label for="CandidateCompetencies" class="col-md-2 col-form-label">Competencies</label> | |
<div class="col-md-4"> | |
<textarea class="form-control" rows="6" type="text" id="CandidateCompetencies" name="Competencies" style="resize:none;">@Model.Competencies</textarea> | |
</div> | |
</div> | |
<div class="checkbox"> | |
<label><input type="checkbox" value="">Is Tcs employee</label> | |
</div> | |
<div class="form-group row"> | |
<label for="CandidateDescription" class="col-md-2 col-form-label">Description</label> | |
<div class="col-md-4"> | |
<input class="form-control" type="text" id="Description" name="Description" value="@Model.Description"> | |
</div> | |
</div> | |
</div> | |
</form> | |
</div> | |
<div class="pmd-modal-action pmd-modal-bordered text-right"> | |
<button data-dismiss="modal" class="btn pmd-btn-flat pmd-ripple-effect btn-primary" type="button">Cancel</button> | |
<button data-dismiss="modal" type="button" onclick="javascript: void (0);" class="btn pmd-btn-flat pmd-ripple-effect btn-default">Save</button> | |
</div> | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using PagedList.Mvc; @*import this so we get our HTML Helper*@ | |
@using PagedList; @*import this so we can cast our list to IPagedList (only necessary because ViewBag is dynamic)*@ | |
@model Tuple<List<Talento.Models.PositionCandidateViewModel>, Talento.Models.PositionModel> | |
@{ | |
ViewBag.Title = "Position details"; | |
Layout = "~/Views/Shared/_LayoutDashboard.cshtml"; | |
} | |
<!-- import the included stylesheet for some (very basic) default styling --> | |
<link href="/Content/PagedList.css" rel="stylesheet" type="text/css" /> | |
<div class="row"> | |
<div class="col-md-8"> | |
<h2>Positions</h2> | |
<div> | |
<div class="col-md-7"> | |
<b>Title:</b> @Html.DisplayFor(x => x.Item2.Title) | |
</div> | |
<div class="col-md-5"> | |
<b>Creation date:</b> @Html.DisplayFor(x => x.Item2.CreationDate) | |
</div> | |
</div> | |
<div class="bottom"> </div> | |
<br /> | |
<div class="col-md-11"> | |
<p><b>Description: </b>@Html.DisplayFor(x => x.Item2.Description)</p> | |
<p><b>Area: </b>@Html.DisplayFor(x => x.Item2.Area)<p /> | |
<p><b>Owner: </b>@Html.DisplayFor(x => x.Item2.Owner.UserName)<p /> | |
<p><b>Engagement Manager: </b>@Html.DisplayFor(x => x.Item2.EngagementManager)<p /> | |
<p><b>Portfolio Manager: </b>@Html.DisplayFor(x => x.Item2.PortfolioManager.UserName)<p /> | |
<p><b>RGS: </b>@Html.DisplayFor(x => x.Item2.RGS)<p /> | |
<p><b>Status: </b>@Html.DisplayFor(x => x.Item2.Status)<p /> | |
</div> | |
<div class="col-md-8"> | |
@*<input type="button" name="back" class="btn pmd-ripple-effect btn-primary" value="Back" onclick="@("window.location.href='" + @Url.Action("Index", "Dashboard") + "'");" />*@ | |
<a href="@Url.Action("Index", "Dashboard")" alt="Back"> | |
<i class="material-icons md-24">keyboard_arrow_left</i> | |
</a> | |
@*<input type="button" name="edit" value="Edit" onclick="@("window.location.href='" + @Url.Action("Edit", "Positions", new { id = Model.Item2.Id }) + "'");" />*@ | |
<a href="@Url.Action("Edit", "Positions", new { id = Model.Item2.Id })" alt="Edit position"> | |
<i class="material-icons md-24">mode_edit</i> | |
</a> | |
@*<input data-target="#complete-dialog" data-toggle="modal" class="btn btn-danger pmd-ripple-effect btn-primary pmd-z-depth" value="Delete" />*@ | |
<a href="@Url.Action("Delete", "Positions")" data-target="#complete-dialog" alt="Delete position"> | |
<i class="material-icons md-24">delete</i> | |
</a> | |
<!--Delete position modal--> | |
<div tabindex="-1" class="modal fade" id="complete-dialog" style="display: none;" aria-hidden="true"> | |
<div class="modal-dialog"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal">×</button> | |
<h4 class="modal-title">Delete profile</h4> | |
</div> | |
<div class="pmd-modal-action pmd-modal-bordered text-right"> | |
<button data-dismiss="modal" class="btn pmd-btn-flat pmd-ripple-effect btn-primary" type="button">Cancel</button> | |
<button data-dismiss="modal" type="button" onclick="@("window.location.href='" + @Url.Action("Delete", "Positions", new { id = Model.Item2.Id }) + "'");" class="btn pmd-btn-flat pmd-ripple-effect btn-default">Delete</button> | |
</div> | |
</div> | |
</div> | |
</div> | |
<!--Delete position modal--> | |
</div> | |
</div> | |
<div class="col-sm-4"> | |
@* Partial of Logs *@ | |
@Html.Action("List", "PositionLogs", new { id = Model.Item2.Id }) | |
</div> | |
</div> | |
<div class="row"> | |
<div class="col-md-12"> | |
<h2>Candidates</h2> | |
<!--pagination--> | |
<table class="table" id="candidates-list"> | |
<thead> | |
<tr> | |
<th>Email</th> | |
<th>Created On</th> | |
<th>Created By</th> | |
<th>Status</th> | |
</tr> | |
</thead> | |
@foreach (var cP in ViewBag.onePageOfCandidatePositions) | |
{ | |
<tr> | |
<td> | |
@cP.Candidate.Email | |
</td> | |
<td> | |
@cP.Candidate.CratedOn | |
</td> | |
<td> | |
@cP.Candidate.CreatedBy.Email | |
</td> | |
<td> | |
@cP.Candidate.Status | |
</td> | |
<td> | |
<a href="@Url.Action("EditCandidate", "Positions",new { EditId = cP.Candidate_Id } )" class="material-icons md-24 edit-candidate" data-toggle="modal" data-target="#edit-position-dialog" alt="Edit candidate"> | |
mode_edit | |
</a> | |
</td> | |
<td> | |
<a href="#" data-toggle="modal" data-target="#delete-position-dialog" alt="Delete candidate"> | |
<i class="material-icons md-24">delete</i> | |
</a> | |
</td> | |
<td> | |
<a href="#" data-toggle="modal" alt="Add profile"> | |
<i class="material-icons md-24">note_add</i> | |
</a> | |
</td> | |
</tr> | |
} | |
</table> | |
<script> | |
window.onload = function () { | |
(function ($) { | |
// start dude | |
var $parent = $('#candidates-list'); | |
console.log("first trigger"); | |
$parent.on("click", '.edit-candidate', function (event) { | |
console.log("candidate trigger"); | |
event.preventDefault(); | |
// vars | |
var $this = $(this); | |
var $target = $($this.attr('data-target')); | |
var $url = $this.attr('href'); | |
$target.html(''); | |
$.ajax({ | |
url: $url | |
}).fail(function (err) { | |
var html = '<div class="modal-dialog"> \ | |
< div class="modal-content" > \ | |
<div class="modal-body" id="edit-position-dialog-body"> Error:'+ err +'</div></div></div>'; | |
$target.html(html); | |
}).done(function (result) { | |
console.log("Load trigger"); | |
$target.html(result); | |
$target.modal() | |
}); | |
}); | |
}(jQuery)); | |
} | |
</script> | |
<!--pagination--> | |
<!-- output a paging control that lets the user navigation to the previous page, next page, etc --> | |
@Html.PagedListPager((IPagedList)ViewBag.onePageOfCandidatePositions, page => Url.Action("Details", "Positions", new { Model.Item2.Id, page })) | |
<!--Delete profile modal--> | |
<div tabindex="-1" class="modal fade" id="delete-position-dialog" style="display: none;" aria-hidden="true"> | |
<div class="modal-dialog"> | |
<div class="modal-content"> | |
<div class="modal-body"> | |
<p>Do you want to delete this profile?</p> | |
</div> | |
<div class="pmd-modal-action pmd-modal-bordered text-right"> | |
<button data-dismiss="modal" class="btn pmd-btn-flat pmd-ripple-effect btn-primary" type="button">Cancel</button> | |
<button data-dismiss="modal" type="button" onclick="@("window.location.href='" + @Url.Action(null, null, new { id = Model.Item2.Id }) + "'");" class="btn pmd-btn-flat pmd-ripple-effect btn-default">Delete</button> | |
</div> | |
</div> | |
</div> | |
</div> | |
<!--Delete profile modal--> | |
<!--Edit profile modal--> | |
<div tabindex="-1" class="modal fade" id="edit-position-dialog" aria-hidden="true"></div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment