-
Notifications
You must be signed in to change notification settings - Fork 0
/
ParaHacerTest
53 lines (47 loc) · 2.13 KB
/
ParaHacerTest
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#para probar los test de los estados
def finished?(current_user)
user_results = my_results(current_user)
if user_results.nil? or user_results.time_end.nil? or self.complete?(current_user)
false
else
true
end
end
def begin?(current_user)
user_results = my_results(current_user)
if user_results.nil? or self.finished?(current_user)
false
else
true
end
end
def complete?(current_user)
user_results = my_results(current_user)
if user_results.nil? or user_results.question_score.nil?
false
else
true
end
end
<%= link_to t('.destroy', :default => t("helpers.links.destroy")),
project_task_subtask_path(@project,@task,subtask),
:method => :delete,
:data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
:class => 'btn btn-mini btn-danger' %>
<%= link_to t('.edit', :default => t("helpers.links.edit")),
edit_project_task_subtask_path(@project,@task,subtask), :class => 'btn' %>
<%else%>
<%if subtask.complete?(current_user)%>
<%=link_to raw("<i class=' icon-eye-open'></i> edit") , project_task_subtask_end_path(@project,@task,subtask), :class => 'btn btn-primary'%>
<%elsif subtask.finished?(current_user) %>
<%=link_to raw("<i class='icon-question-sign'></i> respond") , project_task_subtask_end_path(@project,@task,subtask), :class => 'btn btn-warning'%>
<%elsif subtask.begin?(current_user)%>
<%= link_to raw("<i class=' icon-thumbs-up'></i> end"),
project_task_subtask_end_path(@project,@task,subtask),
:class => "btn btn-warning",
:data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) } %>
<%else%>
<%=link_to raw("<i class='icon-hand-right '></i> begin") , project_task_subtask_begin_path(@project,@task,subtask),
:class => 'btn btn-success',
:data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) } %>
<%end%>