Sha256: 11e230543f455ada4a0b4612927df662f3bb4b12e2556767dea78ba883a07b40

Contents?: true

Size: 1.81 KB

Versions: 4

Compression:

Stored size: 1.81 KB

Contents

<?

  type = args[:section].downcase.scan(/task|test/).first

  if args[:task_name]
    raise Mutx::Error::TaskNotFound.new("Could not find task with name #{args[:task_name]}") unless Mutx::Tasks.is_there_task_with? args[:task_name]
    template = Mote.parse(File.read("#{Mutx::View.path}/tasks/task.mote"), self, [:task_data])
    task_data = Mutx::API::Task.info_for_name(args[:task_name])
    content = template.call(task_data:task_data)
  else

    template = Mote.parse(File.read("#{Mutx::View.path}/tasks/task_item.mote"), self, [:task])

    tasks_list = Mutx::API::Tasks.list(type:type)
  end

?>

% unless args[:task_name]
  % number_of_tasks = tasks_list["tasks"].size
  <div class="bs-callout bs-callout-danger">
    <h4>&nbsp;&nbsp;&nbsp;Showing {{number_of_tasks}} {{type}}{{number_of_tasks>1 ? 's':''}}<small>&nbsp;&nbsp;Click on any task to open it</small></h4>
  </div>
% end
% if args[:task_name]
  {{content}}
% else
  % tasks_list_aux = []

  % tasks_list["tasks"].each do |task|
  %   res = nil
  %   res = Mutx::Database::MongoConnector.running_results_for_task_id(task["_id"])
  %   tasks_list_aux << task if res.empty?
  %   tasks_list_aux.unshift(task) if !res.empty?
  % end

  % tasks_list = tasks_list_aux
  % tasks_list.each do |task_data|
    {{template.call(task:task_data)}}
  % end
  % if tasks_list.empty?
    <br>
    <br>
    <div id='well'>
      <h3>No tasks defined, create a new task to run!</h3>
    </div>
    <br>
    <br>
  % end
% end

<style>
#well {
  aling: right;
  height: 50px;
  background: #F5F5F5;
  width: 600px;
  font-size: 20px;
  #font-style: oblique;
  color: #696969;
  text-align: center;
  padding: 0 20px;
  margin: 20px;
  display: flex;
  justify-content: center;
  /* align horizontal */
  align-items: center;
  /* align vertical */
  margin-right: auto;
  margin-left: auto;
}
</style>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mutx-0.1.47 lib/mutx/view/tasks/tasks.mote
mutx-0.1.46 lib/mutx/view/tasks/tasks.mote
mutx-0.1.45 lib/mutx/view/tasks/tasks.mote
mutx-0.1.44 lib/mutx/view/tasks/tasks.mote