From 7c9aa2e476ea5a2860ca67607fb679a5e91204a7 Mon Sep 17 00:00:00 2001 From: Luka Murn Date: Mon, 6 Mar 2017 16:01:04 +0100 Subject: [PATCH] Hide complete&uncomplete task buttons if user cannot do it Closes SCI-1091. --- app/views/my_modules/_state_buttons.html.erb | 36 +++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/app/views/my_modules/_state_buttons.html.erb b/app/views/my_modules/_state_buttons.html.erb index b4788f7b1..e9578978f 100644 --- a/app/views/my_modules/_state_buttons.html.erb +++ b/app/views/my_modules/_state_buttons.html.erb @@ -1,20 +1,22 @@
-
- <% if !@my_module.completed? %> -
- -
- <% else @my_module.completed? %> -
- -
- <% end %> -
+ <% if can_complete_module(@my_module) %> +
+ <% if !@my_module.completed? %> +
+ +
+ <% elsif @my_module.completed? %> +
+ +
+ <% end %> +
+ <% end %>
\ No newline at end of file