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 ...@@ -44,7 +44,7 @@ class ApiController < ApplicationController
@jobr.save @jobr.save
# Send notification to admin there is a pending job # 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 # Send notification to user that the job is received and pending approval
JobwaitingMailer.jobpending(@jobr).deliver JobwaitingMailer.jobpending(@jobr).deliver
......
class JobwaitingMailer < ActionMailer::Base class JobwaitingMailer < ActionMailer::Base
default from: 'no-reply@insomnia247.nl' default from: 'no-reply@insomnia247.nl'
def jobwaiting(jobrequest) def jobwaiting(jobrequest, comments)
@jobrequest = jobrequest @jobrequest = jobrequest
@comments = comments
mail :to => 'coolfire@insomnia247.nl', :subject => "New pending job for #{@jobrequest.user}" mail :to => 'coolfire@insomnia247.nl', :subject => "New pending job for #{@jobrequest.user}"
end end
def jobpending(jobrequest) def jobpending(jobrequest)
@jobrequest = jobrequest @jobrequest = jobrequest
job = Command.find(jobrequest.command_id) job = Command.find(jobrequest.command_id)
mail :to => @jobrequest.email, :subject => "#{@job.name} pending" mail :to => jobrequest.email, :subject => "#{job.name} pending"
end end
def jobdisapproved(jobrequest, reason) def jobdisapproved(jobrequest, reason)
......
...@@ -21,6 +21,10 @@ ...@@ -21,6 +21,10 @@
<td>Arguments</td> <td>Arguments</td>
<td><%= @jobrequest.args %></td> <td><%= @jobrequest.args %></td>
</tr> </tr>
<tr>
<td>Comments</td>
<td><%= @comments %></td>
</tr>
</table> </table>
</p> </p>
</body> </body>
......
...@@ -22,6 +22,7 @@ body{ ...@@ -22,6 +22,7 @@ body{
} }
.pagetitle{ .pagetitle{
padding-left: 10px;
font-size : 150%; font-size : 150%;
font-weight: bold; font-weight: bold;
} }
...@@ -102,7 +103,11 @@ body{ ...@@ -102,7 +103,11 @@ body{
} }
.serverdesc td{ .serverdesc td{
padding-right: 15px; padding-left: 15px;
}
.newserverjob{
padding-left: 15px;
} }
.serverdesc table{ .serverdesc table{
......
...@@ -104,7 +104,7 @@ def results(options, config) ...@@ -104,7 +104,7 @@ def results(options, config)
'timestamp' => message['timestamp'], 'timestamp' => message['timestamp'],
'exitcode' => message['exitcode'], 'exitcode' => message['exitcode'],
'message' => message['message'], 'message' => message['message'],
'key' => config['api_pass'] 'key' => config['api_pass'],
} }
) )
end end
...@@ -153,6 +153,7 @@ def requests(options, config) ...@@ -153,6 +153,7 @@ def requests(options, config)
'user' => message['user'], 'user' => message['user'],
'email' => message['email'], 'email' => message['email'],
'key' => config['api_pass'] 'key' => config['api_pass']
'comments' => message['comments'],
} }
) )
end 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