Commit f5296eab85ceed0c5afd433a62a6cc82d44856e1

Authored by Aníbal Pacheco
1 parent 4206d99316
Exists in master

Default assignee is the current user instead of anyone

Showing 3 changed files with 10 additions and 2 deletions Side-by-side Diff

app/controllers/taskboard_controller.rb View file @ f5296ea
... ... @@ -8,6 +8,7 @@
8 8 def index
9 9 @columns = TaskBoardColumn.where(:project_id => @project.id).order('weight').all()
10 10 @status_names = Hash.new
  11 + @user = User.current
11 12 IssueStatus.select([:id, :name]).each do |status|
12 13 @status_names[status.id] = status.name
13 14 end
app/views/taskboard/index.html.erb View file @ f5296ea
... ... @@ -8,6 +8,8 @@
8 8 <%= select_tag("priority", options_for_select([['Any', '0']] + IssuePriority.all.collect { |m| [ m.name, m.id ] } )) %>
9 9 <%= label_tag "category", "Category" %>
10 10 <%= select_tag("category", options_for_select([['Any', '0']] + @project.issue_categories.collect { |m| [ m.name, m.id ] } )) %>
  11 + <input type="hidden" id="page_is_dirty" name="page_is_dirty" value="0" />
  12 + <input type="hidden" id="user_id" name="user_id" value="<%= @user.id %>" />
11 13 </p>
12 14 </div>
13 15  
assets/javascripts/task_board.js View file @ f5296ea
... ... @@ -51,7 +51,12 @@
51 51 self.filters[$(this).attr('name')] = parseInt($(this).val());
52 52 self.applyFilters();
53 53 });
54   - self.applyFilters();
  54 + if ($("#page_is_dirty").val() == 0) {
  55 + $("#assignee option[value=" + $("#user_id").val() + "]").prop("selected", true).change();
  56 + } else {
  57 + self.applyFilters();
  58 + }
  59 + $("#page_is_dirty").val(1);
55 60 },
56 61 applyFilters: function() {
57 62 var self = this;