Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting hash fixed #58

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions app/controllers/adsprints_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def list
@project.assignable_users.each{|u| @assignables[u.id] = u.firstname + ' ' + u.lastname}
@project_id = @project.id
@plugin_path = File.join(Redmine::Utils.relative_url_root, 'plugin_assets', 'AgileDwarf')
@closed_status = Setting.plugin_AgileDwarf[:stclosed].to_i
@closed_status = Setting.plugin_AgileDwarf["stclosed"].to_i
end

private
Expand All @@ -20,4 +20,4 @@ def find_project
# @project variable must be set before calling the authorize filter
@project = Project.find(params[:project_id])
end
end
end
6 changes: 3 additions & 3 deletions app/controllers/adtaskinl_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def update
def create
attribs = params.select{|k,v| k != 'id' and SprintsTasks.column_names.include? k }
attribs = Hash[*attribs.flatten]
attribs['tracker_id'] = attribs['tracker_id'] || Setting.plugin_AgileDwarf[:tracker]
attribs['tracker_id'] = attribs['tracker_id'] || Setting.plugin_AgileDwarf['tracker']
attribs['author_id'] = User.current.id
task = SprintsTasks.new(attribs)
begin
Expand All @@ -50,7 +50,7 @@ def tooltip
end

def spent
spenttime = TimeEntry.new({:hours => params[:hours], :activity_id => Setting.plugin_AgileDwarf[:activity], :user => User.current, :project => @project, :spent_on => Date.today,
spenttime = TimeEntry.new({:hours => params[:hours], :activity_id => Setting.plugin_AgileDwarf["activity"], :user => User.current, :project => @project, :spent_on => Date.today,
:issue_id => params[:id]})
begin
spenttime.save!
Expand Down Expand Up @@ -97,4 +97,4 @@ def find_project
# @project variable must be set before calling the authorize filter
@project = Project.find(params[:project_id])
end
end
end
7 changes: 3 additions & 4 deletions app/controllers/adtasks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ def list
user = nil if @user == 'all'

@plugin_path = File.join(Redmine::Utils.relative_url_root, 'plugin_assets', 'AgileDwarf')

status_ids = []
colcount = Setting.plugin_AgileDwarf[:stcolumncount].to_i
colcount = Setting.plugin_AgileDwarf['stcolumncount'].to_i
for i in 1 .. colcount
status_ids << Setting.plugin_AgileDwarf[('stcolumn' + i.to_s).to_sym].to_i
status_ids << Setting.plugin_AgileDwarf[('stcolumn' + i.to_s)].to_i
end
@statuses = {}
IssueStatus.find_all_by_id(status_ids).each {|x| @statuses[x.id] = x.name}
Expand All @@ -45,4 +44,4 @@ def find_project
# @project variable must be set before calling the authorize filter
@project = Project.find(params[:project_id])
end
end
end
4 changes: 2 additions & 2 deletions app/views/adsprints/_task.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div id="task.<%=h task.id %>" class="sc_task <%= @closed_status == task.status_id ? 'closed_task' : '' %>">
<div id="task.<%=h task.id %>" class="sc_task sc_task_tracker_<%= Tracker.find(task.tracker_id).name %> <%= task.children.count == 0 or Tracker.find(task.tracker_id).name != 'UserStorie' ? '' : 'sc_task_hide' %> <%= @closed_status == task.status_id ? 'closed_task' : '' %>">
<div class="fl task_no">#<%= link_to task.id, :controller => 'issues', :action => 'show', :id => task %></div>
<div class="fl task_desc"><img src="<%= File.join(@plugin_path, 'images', 'task_desc.png') %>"/></div>
<div class="task_subject"><%=h task.subject %></div>
<div class="task_estimate fl"><%=h task.estimated_hours || l(:label_sprints_placeholder_estimated) %></div>
<div class="task_owner fr"><%=h task.assigned_to %></div>
</div>
</div>
4 changes: 2 additions & 2 deletions app/views/adtasks/_task.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="task.<%=h task.id %>" class="sc_task">
<div id="task.<%=h task.id %>" class="sc_task sc_task_tracker_<%= Tracker.find(task.tracker_id).name %> <%= task.children.count == 0 or Tracker.find(task.tracker_id).name != 'UserStorie' ? '' : 'sc_task_hide' %>">
<div class="fl task_no">#<%= link_to task.id, :controller => 'issues', :action => 'show', :id => task %></div>
<div class="fl task_desc"><img src="<%= File.join(@plugin_path, 'images', 'task_desc.png') %>"/></div>
<div class="task_subject" title="<%=h task.subject %>"><%=h task.subject %></div>
Expand All @@ -21,4 +21,4 @@
<div class="measure fr">h</div>
<div class="fr task_spent_time"><%=h task.spent || '0' %></div>
</div>
</div>
</div>
20 changes: 10 additions & 10 deletions app/views/shared/_settings.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,47 @@

<p>
<%= content_tag(:label, l(:label_settings_tracker)) %>
<%= select_tag("settings[tracker]", options_from_collection_for_select(Tracker.all, :id, :name, Setting.plugin_AgileDwarf[:tracker].to_i)) %>
<%= select_tag("settings[tracker]", options_from_collection_for_select(Tracker.all, :id, :name, Setting.plugin_AgileDwarf['tracker'].to_i)) %>
</p>

<p>
<%= content_tag(:label, l(:label_settings_activity)) %>
<%= select_tag("settings[activity]", options_from_collection_for_select(TimeEntryActivity.all, :id, :name, Setting.plugin_AgileDwarf[:activity].to_i)) %>
<%= select_tag("settings[activity]", options_from_collection_for_select(TimeEntryActivity.all, :id, :name, Setting.plugin_AgileDwarf['activity'].to_i)) %>
</p>

<p>
<%= content_tag(:label, l(:label_settings_closedstatus)) %>
<%= select_tag("settings[stclosed]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf[:stclosed].to_i)) %>
<%= select_tag("settings[stclosed]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf['stclosed'].to_i)) %>
</p>

<p>
<%= content_tag(:label, l(:label_settings_columncount)) %>
<%= select_tag("settings[stcolumncount]", options_for_select([2, 3, 4, 5], Setting.plugin_AgileDwarf[:stcolumncount].to_i)) %>
<%= select_tag("settings[stcolumncount]", options_for_select([2, 3, 4, 5], Setting.plugin_AgileDwarf['stcolumncount'].to_i)) %>
</p>

<div id="stcolumns">
<p>
<%= content_tag(:label, l(:label_settings_column1status)) %>
<%= select_tag("settings[stcolumn1]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf[:stcolumn1].to_i)) %>
<%= select_tag("settings[stcolumn1]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf['stcolumn1'].to_i)) %>
</p>

<p>
<%= content_tag(:label, l(:label_settings_column2status)) %>
<%= select_tag("settings[stcolumn2]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf[:stcolumn2].to_i)) %>
<%= select_tag("settings[stcolumn2]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf['stcolumn2'].to_i)) %>
</p>

<p>
<%= content_tag(:label, l(:label_settings_column3status)) %>
<%= select_tag("settings[stcolumn3]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf[:stcolumn3].to_i)) %>
<%= select_tag("settings[stcolumn3]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf['stcolumn3'].to_i)) %>
</p>

<p>
<%= content_tag(:label, l(:label_settings_column4status)) %>
<%= select_tag("settings[stcolumn4]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf[:stcolumn4].to_i)) %>
<%= select_tag("settings[stcolumn4]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf['stcolumn4'].to_i)) %>
</p>

<p>
<%= content_tag(:label, l(:label_settings_column5status)) %>
<%= select_tag("settings[stcolumn5]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf[:stcolumn5].to_i)) %>
<%= select_tag("settings[stcolumn5]", options_from_collection_for_select(IssueStatus.all, :id, :name, Setting.plugin_AgileDwarf['stcolumn5'].to_i)) %>
</p>
</div>
</div>
5 changes: 3 additions & 2 deletions assets/javascripts/burndown.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ var Burndown = function ($)
else
{
// rest of work = ((100 - done_ratio) * estimate) / 100
sum += ((100 - task.done_ratio) * (task.estimated_hours || 0)) / 100;
console.log(task.sprints_tasks.done_ratio);
sum += ((100 - task.sprints_tasks.done_ratio) * (task.sprints_tasks.estimated_hours || 0)) / 100;
}
}
// add new point to series
Expand Down Expand Up @@ -209,4 +210,4 @@ var Burndown = function ($)
});

return obj;
}(jQuery);
}(jQuery);
4 changes: 2 additions & 2 deletions assets/javascripts/libs/jquery.jeditable.ptext.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
$.editable.addInputType('ptext', {
element : function(settings, original)
{
var input = $('<input type="text"/>');
var input = $(document.createElement('input'));
input.attr('type','text');
if (settings.width != 'none') { input.attr('width', settings.width); }
if (settings.height != 'none') { input.attr('height', settings.height); }
input.attr('autocomplete','off');
input.attr('placeholder', settings.placeholder);
$(this).append(input);
input.textPlaceholder();
return input;
}
});
19 changes: 18 additions & 1 deletion assets/stylesheets/sprints.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,23 @@
-webkit-box-shadow: 0 0 4px #1f6993;
}


.task_list .sc_task_hide
{
display:None;
}

.task_list .sc_task.sc_task_tracker_UserStorie
{
border-color: #276DFA;
background: rgba(39, 109, 250, 0.3);
box-shadow: 0 0 4px #276DFA;
-moz-box-shadow: 0 0 4px #276DFA;
-ms-box-shadow: 0 0 4px #276DFA;
-o-box-shadow: 0 0 4px #276DFA;
-webkit-box-shadow: 0 0 4px #276DFA;
}

.task_list
{
margin: 0;
Expand Down Expand Up @@ -210,4 +227,4 @@
.time_list
{
margin-right: 5px;
}
}