suite
This commit is contained in:
parent
ab6d2b7d95
commit
473b7f8ed4
@ -1062,3 +1062,53 @@ h1{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.big_icon{
|
||||||
|
font-size:2em;
|
||||||
|
display:inline-block;
|
||||||
|
margin-right:10px;
|
||||||
|
text-decoration:none;
|
||||||
|
color:rgba(0,0,0,0.2);
|
||||||
|
|
||||||
|
&.active{
|
||||||
|
color:#ffd400;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.done{
|
||||||
|
color:green;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fire{
|
||||||
|
color:red;
|
||||||
|
}
|
||||||
|
.undone, .unfire{
|
||||||
|
color:rgba(0,0,0,0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.i_task_row{
|
||||||
|
margin:10px 0;
|
||||||
|
padding:0px 0;
|
||||||
|
|
||||||
|
.icon{
|
||||||
|
background:transparent !important;
|
||||||
|
}
|
||||||
|
.qi_pannel.padding{
|
||||||
|
padding:10px;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
td{
|
||||||
|
border:0 !important;
|
||||||
|
border:0 !important;
|
||||||
|
vertical-align: middle !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
table{
|
||||||
|
margin:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -43,6 +43,25 @@ class Admin::ITasksController < ApplicationController
|
|||||||
def create
|
def create
|
||||||
@i_task = ITask.new(params.require(:i_task).permit!)
|
@i_task = ITask.new(params.require(:i_task).permit!)
|
||||||
|
|
||||||
|
if @i_task.name? and (tasks = @i_task.name.split(";")).size > 1
|
||||||
|
tasks.each do |task|
|
||||||
|
t = @i_task.dup
|
||||||
|
t.name = task.lstrip
|
||||||
|
t.save
|
||||||
|
end
|
||||||
|
|
||||||
|
if @i_task.i_website
|
||||||
|
@i_website = @i_task
|
||||||
|
@new_i_task = @i_task.i_website.i_tasks.new
|
||||||
|
@i_tasks = @i_task.i_website.i_tasks.order("end_at ASC").all
|
||||||
|
else
|
||||||
|
@i_tasks = ITask.order("end_at ASC").all
|
||||||
|
end
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if @i_task.save
|
if @i_task.save
|
||||||
if @i_task.i_website
|
if @i_task.i_website
|
||||||
@ -58,6 +77,7 @@ class Admin::ITasksController < ApplicationController
|
|||||||
render action: "new"
|
render action: "new"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
.qi_row
|
.qi_row
|
||||||
|
|
||||||
#i_task_form
|
#i_task_form
|
||||||
-@i_tasks = ITask.all
|
-@i_tasks = ITask.where(:i_previ_id => 1, :done => false).all
|
||||||
=render :partial => "admin/i_tasks/form", :locals => {:new_var => true}
|
=render :partial => "admin/i_tasks/form", :locals => {:new_var => true}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,25 +1,52 @@
|
|||||||
.qi_row.i_task_row#i_task{:id => i_task.id}
|
.qi_row.i_task_row#i_task{:id => i_task.id}
|
||||||
.qi_pannel.qi_plain.padding
|
.qi_pannel.qi_plain.padding{:style => ("background:linear-gradient(to bottom, white 50%,rgba(242, 38, 19, 0.2) 80%,rgba(242, 38, 19, 0.7) 100%);" if (!i_task.done and i_task.end_at and i_task.end_at < Date.today) and !params[:no_detail])}
|
||||||
%table.table
|
%table.table
|
||||||
|
|
||||||
%tr
|
%tr
|
||||||
%td{:style => "width:20px;"}
|
%td{:style => (params[:no_detail] ? "width:50px;" : "width:230px;")}
|
||||||
-if i_task.done
|
-if i_task.done
|
||||||
=link_to admin_i_task_path(:id => i_task.id, :i_task => {:done => false}), :remote => true, :method => :put do
|
=link_to admin_i_task_path(:id => i_task.id, :i_task => {:done => false}), :remote => true, :method => :put do
|
||||||
.done
|
.big_icon.done
|
||||||
=ic :check
|
=ic :check
|
||||||
-else
|
-else
|
||||||
=link_to admin_i_task_path(:id => i_task.id, :i_task => {:done => true}), :remote => true, :method => :put do
|
=link_to admin_i_task_path(:id => i_task.id, :i_task => {:done => true}), :remote => true, :method => :put do
|
||||||
.undone
|
.big_icon.undone
|
||||||
=ic :check
|
=ic :check
|
||||||
|
|
||||||
|
-if !params[:no_detail]
|
||||||
|
-if i_task.urgent
|
||||||
|
=link_to admin_i_task_path(:id => i_task.id, :i_task => {:urgent => false}), :remote => true, :method => :put do
|
||||||
|
.big_icon.fire{:style => ("color:green" if i_task.done) }
|
||||||
|
=ic :"free-code-camp"
|
||||||
|
-else
|
||||||
|
=link_to admin_i_task_path(:id => i_task.id, :i_task => {:urgent => true}), :remote => true, :method => :put do
|
||||||
|
.big_icon.unfire
|
||||||
|
=ic :"free-code-camp"
|
||||||
|
|
||||||
|
|
||||||
|
-[[1, :star],[2, :"arrow-right"],[3, :history]].each do |number|
|
||||||
|
|
||||||
|
|
||||||
|
-if i_task.i_previ_id == number[0]
|
||||||
|
=link_to admin_i_task_path(:id => i_task.id, :i_task => {:i_previ_id => nil}), :remote => true, :method => :put do
|
||||||
|
.big_icon.active
|
||||||
|
=ic number[1]
|
||||||
|
-else
|
||||||
|
=link_to admin_i_task_path(:id => i_task.id, :i_task => {:i_previ_id => number[0]}), :remote => true, :method => :put do
|
||||||
|
.big_icon
|
||||||
|
=ic number[1]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%td= i_task.name
|
%td= i_task.name
|
||||||
|
-if !@i_website
|
||||||
%td.project{:style => "width:200px;"}
|
%td.project{:style => "width:200px;"}
|
||||||
= i_task.i_website.name if i_task.i_website
|
= i_task.i_website.name if i_task.i_website
|
||||||
%br
|
%br
|
||||||
= i_task.p_customer.show_name if i_task.p_customer
|
= i_task.p_customer.show_name if i_task.p_customer
|
||||||
|
-if !params[:no_detail]
|
||||||
%td.time{:style => "width:100px;"}
|
%td.time{:style => "width:100px;"}
|
||||||
-if i_task.minutes
|
-if i_task.minutes
|
||||||
= i_task.minutes
|
= i_task.minutes
|
||||||
@ -28,50 +55,10 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%td.actions{:style => "width:120px;"}
|
%td.actions{:style => "width:120px;"}
|
||||||
= link_to i(:"trash-o"), [:admin, i_task], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cette tache ? ' } , :remote => true
|
= link_to i(:"trash-o"), [:admin, i_task], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cette tache ? ' } , :remote => true
|
||||||
= link_to i(:pencil), edit_admin_i_task_path(i_task), :remote => true
|
= link_to i(:pencil), edit_admin_i_task_path(i_task), :remote => true
|
||||||
= link_to i(:eye), admin_i_task_path(i_task)
|
= link_to i(:eye), admin_i_task_path(i_task)
|
||||||
|
|
||||||
|
|
||||||
:scss
|
|
||||||
|
|
||||||
.project,.time,.actions{
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.done,.undone{
|
|
||||||
font-size:2em;
|
|
||||||
|
|
||||||
}
|
|
||||||
.done{
|
|
||||||
color:green;
|
|
||||||
}
|
|
||||||
|
|
||||||
.undone{
|
|
||||||
color:rgba(0,0,0,0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.i_task_row{
|
|
||||||
margin:10px 0;
|
|
||||||
padding:0px 0;
|
|
||||||
|
|
||||||
.qi_pannel.padding{
|
|
||||||
padding:10px;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
td{
|
|
||||||
border:0 !important;
|
|
||||||
border:0 !important;
|
|
||||||
vertical-align: middle !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
table{
|
|
||||||
margin:0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -14,11 +14,12 @@
|
|||||||
=render @i_tasks.where(:end_at => ech.end_at).order("end_at ASC, done DESC")
|
=render @i_tasks.where(:end_at => ech.end_at).order("end_at ASC, done DESC")
|
||||||
|
|
||||||
|
|
||||||
|
-we = @i_tasks.where(:end_at => nil).order("end_at ASC, done DESC")
|
||||||
|
-if we.count > 0
|
||||||
%p{:style => "margin-top:20px;"}
|
%p{:style => "margin-top:20px;"}
|
||||||
%strong Sans échéances
|
%strong Sans échéances
|
||||||
|
|
||||||
=render @i_tasks.where(:end_at => nil).order("end_at ASC, done DESC")
|
=render we
|
||||||
|
|
||||||
%br
|
%br
|
||||||
%br
|
%br
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
.qi_row
|
.qi_row
|
||||||
.qi_pannel.qi_plain.padding#i_task_form
|
.qi_pannel.qi_plain.padding#i_task_form
|
||||||
|
=link_to "Masquer les détails", "?no_detail=true"
|
||||||
=render :partial => "admin/i_tasks/form", :locals => {:new_var => true}
|
=render :partial => "admin/i_tasks/form", :locals => {:new_var => true}
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,6 +20,10 @@
|
|||||||
|
|
||||||
%body.admin
|
%body.admin
|
||||||
#right_bar
|
#right_bar
|
||||||
|
.element
|
||||||
|
=link_to "/" do
|
||||||
|
.cat#big_cat_clients
|
||||||
|
=ic :"home"
|
||||||
|
|
||||||
.element
|
.element
|
||||||
=link_to admin_p_customers_path do
|
=link_to admin_p_customers_path do
|
||||||
|
10
db/migrate/20190602113239_add_some_stuff_to_i_tasks.rb
Normal file
10
db/migrate/20190602113239_add_some_stuff_to_i_tasks.rb
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
class AddSomeStuffToITasks < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :i_tasks, :done_at, :date
|
||||||
|
add_column :i_tasks, :urgent, :boolean, :default => false
|
||||||
|
add_column :i_tasks, :i_previ_id, :integer
|
||||||
|
add_column :i_tasks, :i_task_type_id, :integer
|
||||||
|
add_column :i_tasks, :from_customer, :boolean, :default => false
|
||||||
|
add_column :i_tasks, :i_task_bill_state_id, :integer
|
||||||
|
end
|
||||||
|
end
|
@ -11,7 +11,7 @@
|
|||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20190520102905) do
|
ActiveRecord::Schema.define(version: 20190602113239) do
|
||||||
|
|
||||||
create_table "admin_admin_roles", force: :cascade do |t|
|
create_table "admin_admin_roles", force: :cascade do |t|
|
||||||
t.integer "admin_id", limit: 4
|
t.integer "admin_id", limit: 4
|
||||||
@ -442,6 +442,12 @@ ActiveRecord::Schema.define(version: 20190520102905) do
|
|||||||
t.integer "admin_id", limit: 4
|
t.integer "admin_id", limit: 4
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
|
t.date "done_at"
|
||||||
|
t.boolean "urgent", default: false
|
||||||
|
t.integer "i_previ_id", limit: 4
|
||||||
|
t.integer "i_task_type_id", limit: 4
|
||||||
|
t.boolean "from_customer", default: false
|
||||||
|
t.integer "i_task_bill_state_id", limit: 4
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "i_tasks", ["admin_id"], name: "index_i_tasks_on_admin_id", using: :btree
|
add_index "i_tasks", ["admin_id"], name: "index_i_tasks_on_admin_id", using: :btree
|
||||||
|
Loading…
x
Reference in New Issue
Block a user