Sha256: bbcb28191f6c4bd50d896d2ebd5e4c4dd0e09305f01d4a20662bffb4aef2cc15

Contents?: true

Size: 1.87 KB

Versions: 20

Compression:

Stored size: 1.87 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_list["tasks"].sort_by!{ |m| m["name"].downcase }

  % tasks_list.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

20 entries across 20 versions & 1 rubygems

Version Path
mutx-0.1.68 lib/mutx/view/tasks/tasks.mote
mutx-0.1.67 lib/mutx/view/tasks/tasks.mote
mutx-0.1.66 lib/mutx/view/tasks/tasks.mote
mutx-0.1.65 lib/mutx/view/tasks/tasks.mote
mutx-0.1.64 lib/mutx/view/tasks/tasks.mote
mutx-0.1.63 lib/mutx/view/tasks/tasks.mote
mutx-0.1.62 lib/mutx/view/tasks/tasks.mote
mutx-0.1.61 lib/mutx/view/tasks/tasks.mote
mutx-0.1.60 lib/mutx/view/tasks/tasks.mote
mutx-0.1.59 lib/mutx/view/tasks/tasks.mote
mutx-0.1.58 lib/mutx/view/tasks/tasks.mote
mutx-0.1.57 lib/mutx/view/tasks/tasks.mote
mutx-0.1.56 lib/mutx/view/tasks/tasks.mote
mutx-0.1.55 lib/mutx/view/tasks/tasks.mote
mutx-0.1.54 lib/mutx/view/tasks/tasks.mote
mutx-0.1.53 lib/mutx/view/tasks/tasks.mote
mutx-0.1.52 lib/mutx/view/tasks/tasks.mote
mutx-0.1.51 lib/mutx/view/tasks/tasks.mote
mutx-0.1.50 lib/mutx/view/tasks/tasks.mote
mutx-0.1.49 lib/mutx/view/tasks/tasks.mote