Skip to content
Permalink
Browse files

Weekly commit 2

  • Loading branch information...
lklancir committed Aug 2, 2015
1 parent 67a1a5f commit 567ef28bbdd14bbd82e94667392348e27c1e36a6
@@ -5,9 +5,10 @@
# but you can also edit it by hand.

meteor-platform
mrt:bootstrap-3
jquery
accounts-password
alanning:roles
mrt:bootstrap-3
iron:router
email
accounts-base
@@ -20,19 +20,7 @@


<template name="home">
{{#if isInRole 'employer'}}
<p>samo test</p>

{{#each jobListings}}
<ul>
<li>{{jobTitle}}</li>
<li>{{jobDescription}}</li>
<li>{{jobCategory}}</li>
<li>{{jobLocation}}</li>
</ul>

{{/each}}
{{/if}}
{{>jobs}}
{{#if isInRole 'view-projects'}}
<div class="col-md-4">
<div class="panel panel-default">
@@ -0,0 +1,6 @@
<template name="employeeLayout">
{{>employeeNav}}
{{>yield}}
<hr />
<p>OVO JE EMPLOYEE SEKCIJA FOOTER</p>
</template>
@@ -0,0 +1,30 @@
<template name="employeeNav">
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{pathFor 'home'}}">Sezonci</a>
</div>

<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="navbar">
<ul class="nav navbar-nav">
<li class="active"><a href="{{pathFor 'employeeProfile'}}">PROFIL</a></li>
<li><a href="{{pathFor 'jobs'}}">POSLOVI</a></li>
<li><a href="{{pathFor 'appliedJobs'}}">PRIJAVLJENI POSLOVI</a></li>

</ul>

<ul class="nav navbar-nav navbar-right">
<li><a href="#"></a></li>

</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
</template>
@@ -64,7 +64,12 @@
</li>

<li><a href="{{pathFor route='howItWorks'}}">Kako radi</a></li>
{{#if isInRole 'employer'}}
<li><a href="{{pathFor route='employerProfile'}}">EMPLOYER LINK</a></li>
{{/if}}
{{#if isInRole 'employee'}}
<li><a href="{{pathFor route='employeeProfile'}}">EMPLOYEE LINK</a></li>
{{/if}}

</ul>

@@ -0,0 +1,3 @@
<template name="appliedJobs">
<h1>PRRIJAVLJENI POSLOVI</h1>
</template>
@@ -1,3 +1,8 @@
<template name="employee">
<template name="employeeProfile">
<h1> employeeeeee</h1>
<h2>{{_id}}</h2>
<h2>{{profile.name}} {{profile.surname}}</h2>
{{#with profile}}
Profile name : {{name}}
{{/with}}
</template>
@@ -1,3 +1,5 @@
Meteor.subscribe("jobs");

Template.employeeRegistration.events({
'submit form': function(event){
event.preventDefault();
@@ -19,3 +21,24 @@ Template.employeeRegistration.events({
Router.go('verification');
}
});


Template.jobs.helpers({
jobListings: function(){
return Jobs.find();
}
});

Template.jobs.events({
'click .jobApply': function (e) {
e.preventDefault();
Meteor.call("employeeJobApply", this._id)
}
});

Template.jobs.events({
'click .jobCancelApply': function (e) {
e.preventDefault();
Meteor.call("employeeJobCancelApply", this._id)
}
});
@@ -0,0 +1,25 @@
<template name="jobs">
<h1>SVI POSLOVI</h1>

{{#each jobListings}}
<ul>
<li>{{jobTitle}}</li>
<li><a href="/jobs/{{jobTitle}}">{{_id}}</a></li>
<li>{{jobDescription}}</li>
<li>{{jobCategory}}</li>
<li>{{jobLocation}}</li>
<li>Employer: {{employer}}</li>
<li>Applicants:</li>
<ul>
{{#each applicants}}
<li><a href="/employee/{{this}}">{{this}}</a></li>
{{/each}}
</ul>
<input type="button" name="jobApply" class="jobApply" value="Prijavi">
<input type="button" name="jobCancelApply" class="jobCancelApply" value="Odjavi">
</ul>

{{/each}}


</template>
@@ -0,0 +1,14 @@
<template name="jobsDetailed">
<ul>
<li>{{jobTitle}}</li>
<li>{{jobDescription}}</li>
<li>{{jobCategory}}</li>
<li>{{jobLocation}}</li>
<li>Applicants:</li>
<ul>
{{#each applicants}}
<li><a href="/employee/{{this}}">{{this}}</a></li>
{{/each}}
</ul>
</ul>
</template>
No changes.
@@ -1,12 +1,4 @@
// Meteor.subscribe("profiles");

Template.employerProfile.helpers({
getProfile: function(){
return Users.findOne({_id:this.userId});
}
});


Template.employerRegistration.events({
'submit form': function(event){
event.preventDefault();
@@ -41,6 +33,7 @@ Template.addJob.events({
var jobLocation = $('[name=jobLocation]').val();

var jobData = {
employer:Meteor.userId(),
jobTitle:jobTitle,
jobDescription:jobDescription,
jobCategory:jobCategory,
@@ -51,12 +44,8 @@ Template.addJob.events({
}
});





Template.name.events({
"click #foo": function(event, template){

Template.myJobs.helpers({
listMyJobs: function(){
return Jobs.find({"employer":Meteor.userId()}).fetch();
}
});
@@ -1,3 +1,24 @@
<template name="myJobs">
<h1>MOJI POSLOVI</h1>

{{#if isInRole 'employer'}}
<p>samo test</p>

{{#each listMyJobs}}
<ul>
<li>{{jobTitle}}</li>
<li>{{jobDescription}}</li>
<li>{{jobCategory}}</li>
<li>{{jobLocation}}</li>
<li>Employer: {{employer}}</li>
<li>Applicants:</li>
<ul>
{{#each applicants}}
<li><a href="/employee/{{this}}">{{this}}</a></li>
{{/each}}
</ul>
</ul>

{{/each}}
{{/if}}
</template>
File renamed without changes.
@@ -1 +1,3 @@
Employer = new Meteor.Collection("employer");

//METODA NEKA YA MEPLOYERA

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,36 @@
Jobs = new Meteor.Collection("jobs");

Meteor.methods({
addJob: function (jobData) {
// Make sure the user is logged in before inserting a task
if (! Meteor.userId()) {
throw new Meteor.Error("not-authorized");
}

Jobs.insert(jobData);
},
employeeJobApply: function(jobId){
var job = Jobs.findOne({_id:"jobId"});


Jobs.update({_id:jobId}, {$push:{
applicants: {
$each: [Meteor.userId()]
}
}});
},
employeeJobCancelApply: function(jobId){

Jobs.update({_id:jobId}, {$pull:{
applicants: {
$in: [Meteor.userId()]
}
}});
}



});


// Jobs.update({_id:jobId}, {$addToSet:{ applicants: { $each: [userId] }});
@@ -0,0 +1,15 @@

// ALL TRANSFERRED TO ROUTING LOGIC
// ProfileController=RouteController.extend({
// template:"employeeProfile",
// waitOn:function(){
//
// return Meteor.subscribe("userProfile",this.params._id);
// },
// data:function(){
// var UID=Router.current().params._id;
// return Meteor.users.findOne({
// _id:UID
// });
// }
// });

This file was deleted.

Oops, something went wrong.
Oops, something went wrong.

1 comment on commit 567ef28

@lklancir

This comment has been minimized.

Copy link
Owner Author

commented on 567ef28 Aug 2, 2015

https://cloud.githubusercontent.com/assets/3057440/8768106/090e6040-2e74-11e5-912d-6039a8146fbf.png

Added features and functionalities:

-All users that land on the homepage can now see all job listings (will be only a view for guests as employers/employees will have the job listings inside their dashboards and layouts
-Job listings are updated with fields:
- employer: user who created the job (linkable to the employer)
- applicants: all employees that applied for the job
-Job listings have a button for "apply" and "cancel apply" to a certain job (employee)
-Every Job listing is linked to a detailed view which will have more information about a specific job ( onClick)
-Every Applicant is linked to the specific profile of the employee who applied for the job (public view - will be customisable on the user employee profile in later iterations)
-Cross Linking tested (fetching specific user data based on ID)
-Job posting and applying tested

Second preview version hosted on: http://sezonci_2.meteor.com

Please sign in to comment.
You can’t perform that action at this time.