Initial commit of foodsoft 2
This commit is contained in:
commit
5b9a7e05df
657 changed files with 70444 additions and 0 deletions
4
app/views/tasks/_assignments.haml
Normal file
4
app/views/tasks/_assignments.haml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
- @task.assignments.each do |ass|
|
||||
= ass.user.nick
|
||||
%small= link_to _('Remove'), {:action => "drop_assignment", :id => ass}, :confirm => 'Bist du sicher?', :method => "post"
|
||||
%br/
|
||||
37
app/views/tasks/_form.html.haml
Normal file
37
app/views/tasks/_form.html.haml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
= error_messages_for "task"
|
||||
%p
|
||||
%label{:for => "task_name"}
|
||||
%b=_ 'Subject'
|
||||
%br/
|
||||
= text_field :task, :name
|
||||
%p
|
||||
%label{:for => "task_description"}
|
||||
%b=_ 'Description'
|
||||
%br/
|
||||
= text_area :task, :description, :cols => 50, :rows => 10
|
||||
%p
|
||||
%label{:for => "task_user"}
|
||||
%b=_ 'Responsible people'
|
||||
%small=_ 'tasks can have multiple assignments'
|
||||
/%br/
|
||||
/= render :partial => "assignments"
|
||||
%p
|
||||
%small=_ 'use commas to seperate the names'
|
||||
%br/
|
||||
/= text_field_with_auto_complete :user, :nick, {}, {:tokens => ","}
|
||||
= text_field_with_auto_complete :task, :user_list, {}, {:tokens => ","}
|
||||
%p
|
||||
%label{:for => "task_required_users"}
|
||||
%b= _("How many users are altogether required?")
|
||||
%br/
|
||||
= text_field :task, :required_users, :size => 3
|
||||
%p
|
||||
%label{:for => "task_group"}
|
||||
%b=_ 'Group'
|
||||
%br/
|
||||
= select(:task, :group_id, Group.find(:all, :conditions => "type != 'OrderGroup'", :order => 'name').collect {|g| [ g.name, g.id ] }, { :include_blank => true })
|
||||
%p
|
||||
%label{:for => "task_due_date"}
|
||||
%b=_ 'Due date'
|
||||
%br/
|
||||
= date_select :task, :due_date, :start_year => 2007, :include_blank => true
|
||||
32
app/views/tasks/_list.haml
Normal file
32
app/views/tasks/_list.haml
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
%table
|
||||
%tr
|
||||
%th= _('Due date')
|
||||
%th= _('Subject')
|
||||
%th{:colspan => '2'}
|
||||
= _('Who will make it?')
|
||||
%small= "(" + _("How many are still required?") + ")"
|
||||
- for task in @tasks
|
||||
%tr{:class => cycle('even','odd', :name => "tasks") + (task.done ? " done" : "") }
|
||||
%td= format_date(task.due_date) unless task.due_date.nil?
|
||||
%td= link_to task.name, :controller => "tasks", :action => "show", :id => task
|
||||
%td
|
||||
- unless task.users.empty?
|
||||
- owner = Array.new
|
||||
- task.assignments.each do |ass|
|
||||
- if ass.accepted?
|
||||
- nick = "<span class='accepted'>#{ass.user.nick.to_s}</span>"
|
||||
- else
|
||||
- nick = "<span class='unaccepted'>#{ass.user.nick.to_s} ?</span>"
|
||||
- owner << nick
|
||||
= owner.join(", ")
|
||||
= highlighted_required_users task
|
||||
%td
|
||||
- unless task.is_accepted?(@current_user)
|
||||
%span{:style => "float:left"}= button_to _('Accept task'), :controller => "tasks", :action => "accept", :id => task
|
||||
= button_to _("Reject task"), :controller => "tasks", :action => "reject", :id => task if task.is_assigned?(@current_user)
|
||||
- else
|
||||
- form_for :task, :url => {:action => "update_status", :id => task} do |f|
|
||||
= _("Done") + "?"
|
||||
= f.check_box :done, {:onchange => "submit()"}
|
||||
= _("Done") if task.done
|
||||
- reset_cycle("tasks")
|
||||
19
app/views/tasks/_nav.haml
Normal file
19
app/views/tasks/_nav.haml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#start_nav{:style => "float:right"}
|
||||
%h2=_ 'TaskMenu'
|
||||
%ul
|
||||
%li
|
||||
=_ 'Actions'
|
||||
%ul
|
||||
%li= link_to _('New task'), :action => "new"
|
||||
%li
|
||||
=_ 'Pages'
|
||||
%ul
|
||||
%li= link_to _('My tasks'), :action => "myTasks"
|
||||
%li= link_to _('All tasks'), :action => "index"
|
||||
%li= link_to _('Tasks done'), :action => "archive"
|
||||
|
||||
%li
|
||||
=_ 'Group tasks'
|
||||
%ul
|
||||
- for group in Group.find :all, :conditions => "type != 'OrderGroup'"
|
||||
%li= link_to group.name, :action => "workgroup", :id => group
|
||||
18
app/views/tasks/archive.haml
Normal file
18
app/views/tasks/archive.haml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
- title _('Task archive')
|
||||
= render :partial => "nav"
|
||||
|
||||
%table{:style => "width: 76%"}
|
||||
%tr
|
||||
%th=_ 'Due date'
|
||||
%th=_ 'Subject'
|
||||
%th=_ 'Responsible people'
|
||||
%th
|
||||
- for task in @tasks
|
||||
%tr{:class => cycle('even','odd')}
|
||||
%td= task.due_date unless task.due_date.nil?
|
||||
%td= link_to task.name, :controller => "tasks", :action => "show", :id => task
|
||||
%td
|
||||
- unless task.users.empty?
|
||||
= task.users.map(&:nick).join(", ")
|
||||
%p
|
||||
= link_to_top
|
||||
12
app/views/tasks/edit.haml
Normal file
12
app/views/tasks/edit.haml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
- title _('Edit task')
|
||||
|
||||
#form{:style => "float:left; width:39em"}
|
||||
- form_tag :action => 'update', :id => @task do
|
||||
= render :partial => 'form'
|
||||
= submit_tag _('Save changes')
|
||||
|
|
||||
= link_to _('Cancel'), :action => "show", :id => @task
|
||||
#workgroup_members{:style => "padding-left:41em"}
|
||||
%h3=_ 'Members of the workgroups'
|
||||
#list
|
||||
= render :partial => "/groups/workgroup_members"
|
||||
21
app/views/tasks/index.haml
Normal file
21
app/views/tasks/index.haml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
- title _('Arrange tasks')
|
||||
= render :partial => "nav"
|
||||
|
||||
- unless @non_group_tasks.empty?
|
||||
.left_column{:style => "width:75%"}
|
||||
- @tasks = @non_group_tasks
|
||||
.box_title
|
||||
%h2=_ 'Tasks for all'
|
||||
.column_content
|
||||
= render :partial => "list"
|
||||
|
||||
|
||||
- for @group in @groups
|
||||
- @tasks = @group.open_tasks
|
||||
- unless @tasks.empty?
|
||||
.left_column{:style => "width:75%"}
|
||||
.box_title
|
||||
%h2= link_to @group.name, :action => 'workgroup', :id => @group
|
||||
.column_content
|
||||
= render :partial => "list"
|
||||
= link_to_top
|
||||
27
app/views/tasks/myTasks.haml
Normal file
27
app/views/tasks/myTasks.haml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
- title _("My tasks")
|
||||
= render :partial => "nav"
|
||||
|
||||
- @tasks = @unaccepted_tasks
|
||||
- unless @tasks.empty?
|
||||
.left_column{:style => "width:75%"}
|
||||
.box_title
|
||||
%h2 Offene Aufgaben
|
||||
.column_content
|
||||
= render :partial => "list"
|
||||
|
||||
|
||||
.left_column{:style => "width:75%"}
|
||||
.box_title
|
||||
%h2 Anstehende Aufgaben
|
||||
.column_content
|
||||
- @tasks = @accepted_tasks
|
||||
- unless @tasks.empty?
|
||||
= render :partial => "list"
|
||||
- else
|
||||
Nichts zu tun?
|
||||
= link_to "Hier", :action => "index"
|
||||
gibt es bestimmt Arbeit.
|
||||
%br/
|
||||
= link_to_top
|
||||
|
||||
|
||||
11
app/views/tasks/new.haml
Normal file
11
app/views/tasks/new.haml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
- title _('Create new task')
|
||||
|
||||
#form{:style => "float:left; width:39em"}
|
||||
- form_tag :action => 'create' do
|
||||
= render :partial => 'form'
|
||||
= submit_tag _('Create task')
|
||||
|
||||
#workgroup_members{:style => "padding-left:41em"}
|
||||
%h3=_ 'Members of the workgroups'
|
||||
#list
|
||||
= render :partial => "/groups/workgroup_members"
|
||||
35
app/views/tasks/show.haml
Normal file
35
app/views/tasks/show.haml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
- title _('Task in detail')
|
||||
= render :partial => "nav"
|
||||
|
||||
#task{:style => 'width:70%'}
|
||||
%table
|
||||
%tr
|
||||
%td{:style => "width: 10em"}= _'Name'
|
||||
%td
|
||||
%b= @task.name
|
||||
%tr
|
||||
%td{:style => "vertical-align:top;"}=_ 'Description'
|
||||
%td= simple_format(@task.description)
|
||||
%tr
|
||||
%td=_ 'Due date'
|
||||
%td= format_date(@task.due_date)
|
||||
%tr
|
||||
%td=_ 'Responsible people'
|
||||
%td= render :partial => "assignments"
|
||||
%tr
|
||||
%td=_ 'Group'
|
||||
%td
|
||||
- if @task.group
|
||||
= link_to @task.group.name, :action => "workgroup", :id => @task.group
|
||||
|
||||
%tr
|
||||
%td{:colspan => "2"}
|
||||
%div{:style => "float:left"}=_ 'Done'
|
||||
- form_for :task, :url => {:action => "update_status", :id => @task} do |f|
|
||||
= f.check_box :done, {:onchange => "submit()"}
|
||||
|
||||
|
||||
%p
|
||||
= link_to _('Edit'), :action => "edit", :id => @task
|
||||
|
|
||||
= link_to _('Delete'), {:action => "destroy", :id => @task}, :method => "post", :confirm => _('Delete the task?')
|
||||
59
app/views/tasks/workgroup.haml
Normal file
59
app/views/tasks/workgroup.haml
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
%h1
|
||||
= _('Arrange tasks for')
|
||||
= @group.name
|
||||
= render :partial => "nav"
|
||||
|
||||
.left_column{:style => "width:45em"}
|
||||
.box_title
|
||||
%h2
|
||||
= _('Weekly tasks') + ':'
|
||||
= @group.task_name
|
||||
.column_content
|
||||
- if @group.weekly_task
|
||||
%table.list
|
||||
%tr
|
||||
%th= _('Date')
|
||||
%th= _('Who will make it?')
|
||||
%th= _('Accept task')
|
||||
- i = 0
|
||||
- for nextTask in @group.next_weekly_tasks
|
||||
%tr{:class => cycle("even","odd")}
|
||||
%td= nextTask.strftime("%a, %d.%m.%Y")
|
||||
- if task = @group.tasks.find(:first, :conditions => ["due_date = ? AND name = ?",nextTask.strftime("%Y-%m-%d"),@group.task_name])
|
||||
- unless task.users.empty?
|
||||
- owner = Array.new
|
||||
- task.assignments.each do |ass|
|
||||
- if ass.accepted?
|
||||
- nick = "<span class='accepted'>#{ass.user.nick.to_s}</span>"
|
||||
- else
|
||||
- nick = "<span class='unaccepted'>#{ass.user.nick.to_s} ?</span>"
|
||||
- owner << nick
|
||||
%td
|
||||
= owner.join(", ")
|
||||
%small= link_to _('more'), :action => "edit", :id => task
|
||||
- else
|
||||
%td
|
||||
= link_to _('Assign people'), :action => "edit", :id => task
|
||||
%td
|
||||
- unless task.is_accepted?(@current_user)
|
||||
%span{:style => "float:left"}= button_to _('Accept task'), :controller => "tasks", :action => "accept", :id => task
|
||||
= button_to _('Reject task'), :controller => "tasks", :action => "reject", :id => task if task.is_assigned?(@current_user)
|
||||
- else
|
||||
%td= link_to _('Assign people'), :action => "new", :id => @group, :task_from_now => i
|
||||
%td
|
||||
- i += 1
|
||||
%br/
|
||||
- else
|
||||
= _('No weekly tasks defined yet')
|
||||
= link_to _('Edit weekly tasks'), :controller => "index", :action => "editGroup", :id => @group
|
||||
|
||||
.left_column{:style => "width:75%"}
|
||||
.box_title
|
||||
%h2= _('all tasks')
|
||||
.column_content
|
||||
- @tasks = @group.open_tasks
|
||||
= render :partial => "list"
|
||||
%br/
|
||||
= link_to_top
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue