Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinnie Okada <vokada@mrvinn.com>2014-10-05 09:53:44 +0400
committerVinnie Okada <vokada@mrvinn.com>2014-10-06 07:15:27 +0400
commit9f0083a96c03ec22b1d9442a9c7530899e633301 (patch)
treef41d0cc9e52728884085745e8cb837457a9f3ff2 /app/services/issues
parentff43500024f707a435cbcad43eb4d467368aabfe (diff)
Add task lists to issues and merge requests
Make the Markdown parser recognize "[x]" or "[ ]" at the beginning of a list item and turn it into a checkbox input. Users who can modify the issue or MR can toggle the checkboxes directly or edit the Markdown to manage the tasks. Task status is also displayed in the MR and issue lists.
Diffstat (limited to 'app/services/issues')
-rw-r--r--app/services/issues/update_service.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/services/issues/update_service.rb b/app/services/issues/update_service.rb
index a0e57144435..5b2746ffecf 100644
--- a/app/services/issues/update_service.rb
+++ b/app/services/issues/update_service.rb
@@ -8,9 +8,14 @@ module Issues
Issues::ReopenService.new(project, current_user, {}).execute(issue)
when 'close'
Issues::CloseService.new(project, current_user, {}).execute(issue)
+ when 'task_check'
+ issue.update_nth_task(params[:task_num].to_i, true)
+ when 'task_uncheck'
+ issue.update_nth_task(params[:task_num].to_i, false)
end
- if params.present? && issue.update_attributes(params.except(:state_event))
+ if params.present? && issue.update_attributes(params.except(:state_event,
+ :task_num))
issue.reset_events_cache
if issue.previous_changes.include?('milestone_id')
@@ -28,5 +33,12 @@ module Issues
issue
end
+
+ private
+
+ def update_task(issue, params, checked)
+ issue.update_nth_task(params[:task_num].to_i, checked)
+ params.except!(:task_num)
+ end
end
end