Commit 80cc4be0 authored by Cool Fire's avatar Cool Fire

Implementing support for comments in requests

parent 7f82c313
......@@ -44,7 +44,7 @@ class ApiController < ApplicationController
@jobr.save
# Send notification to admin there is a pending job
JobwaitingMailer.jobwaiting(@jobr).deliver
JobwaitingMailer.jobwaiting(@jobr, params[:comments]).deliver
# Send notification to user that the job is received and pending approval
JobwaitingMailer.jobpending(@jobr).deliver
......
class JobwaitingMailer < ActionMailer::Base
default from: 'no-reply@insomnia247.nl'
def jobwaiting(jobrequest)
def jobwaiting(jobrequest, comments)
@jobrequest = jobrequest
@comments = comments
mail :to => 'coolfire@insomnia247.nl', :subject => "New pending job for #{@jobrequest.user}"
end
def jobpending(jobrequest)
@jobrequest = jobrequest
job = Command.find(jobrequest.command_id)
mail :to => @jobrequest.email, :subject => "#{@job.name} pending"
mail :to => jobrequest.email, :subject => "#{job.name} pending"
end
def jobdisapproved(jobrequest, reason)
......
......@@ -21,6 +21,10 @@
<td>Arguments</td>
<td><%= @jobrequest.args %></td>
</tr>
<tr>
<td>Comments</td>
<td><%= @comments %></td>
</tr>
</table>
</p>
</body>
......
......@@ -22,6 +22,7 @@ body{
}
.pagetitle{
padding-left: 10px;
font-size : 150%;
font-weight: bold;
}
......@@ -102,7 +103,11 @@ body{
}
.serverdesc td{
padding-right: 15px;
padding-left: 15px;
}
.newserverjob{
padding-left: 15px;
}
.serverdesc table{
......
......@@ -104,7 +104,7 @@ def results(options, config)
'timestamp' => message['timestamp'],
'exitcode' => message['exitcode'],
'message' => message['message'],
'key' => config['api_pass']
'key' => config['api_pass'],
}
)
end
......@@ -153,6 +153,7 @@ def requests(options, config)
'user' => message['user'],
'email' => message['email'],
'key' => config['api_pass']
'comments' => message['comments'],
}
)
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment