Skip to content

Commit

Permalink
Merge branch 'release-v1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
dmichel35 committed Jan 6, 2016
2 parents c7b980d + 863c49c commit 60567bb
Show file tree
Hide file tree
Showing 18 changed files with 636 additions and 8 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
repo_token: Gm6Dfv0XwG28Mm2qdfXfkWzn8lFEtIrsu
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'https://rubygems.org'

gem 'coveralls', require: false
gem 'simplecov', "~> 0.9.1", :require => false, :group => :test
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

[![Build Status](https://api.travis-ci.org/echoes-tech/redmine_scrum_cards.svg)](https://travis-ci.org/echoes-tech/redmine_scrum_cards)
[![Coverage Status](https://coveralls.io/repos/echoes-tech/redmine_scrum_cards/badge.svg?branch=develop&service=github)](https://coveralls.io/github/echoes-tech/redmine_scrum_cards?branch=develop)
[![Code Climate](https://codeclimate.com/github/echoes-tech/redmine_scrum_cards/badges/gpa.svg)](https://codeclimate.com/github/echoes-tech/redmine_scrum_cards)

# redmine scrum cards

Expand All @@ -18,3 +20,15 @@ Redmine plugin for generating printable scrum cards.
## Supported Ruby versions

- 2.1

## How to use this plugin

1. Select some issues from the issues list
2. Right click on the issues list and you will see an option to generate scrum cards in the context menu
3. Click on it and it will open a new tab containing all the generated cards for each selected issue <br/><br/>
The generated card of an issue will look like this : <br/><br/>
<center>
![](https://universityofrennes1miage.mybalsamiq.com/mockups/3994506.png?key=97f8f35bbf43d53fa2ae7222290bd7193e650ee6)
</center>
<br/> The date format and the custom field used to detect the user responsible for validating the work of the user assigned to an issue can be customized through the plugin settings panel. <br/><br/>
4. Print! :-)
16 changes: 14 additions & 2 deletions app/controllers/postit_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,26 @@ def generate

if !issues_id.nil?

issues_id.each{ |id| Rails.logger.info "issue #"+id }

# retrieve issues
@issues = Issue.where(id: issues_id)

# reject issues that the current user is not supposed to see
@issues = @issues.reject { |issue| !allowed_to_print?(issue) }

end

render "postit/generate", :layout => false

end

private #---------------------------------------------------------------------------------------------------------

def allowed_to_print?(issue)

return true if User.current.admin

return User.current.allowed_to?({ :controller => 'issues', :action => 'show', :id => issue.id }, issue.project)

end

end
2 changes: 1 addition & 1 deletion app/views/issues/_postit_menu.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%= stylesheet_link_tag('redmine_scrum_cards.css', :plugin => 'redmine_scrum_cards', :media => 'all') %>
<%= link_to "post-it", {
<%= link_to "Scrum Cards", {
:controller => 'postit',
:action => 'generate',
:project_id => @project.id ,
Expand Down
2 changes: 1 addition & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name 'Redmine Scrum Cards plugin'
author 'Echoes'
description 'Plugin for generating printable scrum cards'
version '0.1'
version '1.0.0'
url 'https://github.com/echoes-tech/redmine_scrum_cards'
author_url 'https://github.com/echoes-tech'

Expand Down
5 changes: 5 additions & 0 deletions test/fixtures/issue_categories.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
issue_category_001:
id: 1
name: Super Category 1
project_id: 1
34 changes: 34 additions & 0 deletions test/fixtures/issue_statuses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
issue_statuses_001:
id: 1
name: Nouveau
<% if Redmine::VERSION.to_s[0] == "2" %>
is_default: true
<% end %>
is_closed: false
position: 1
issue_statuses_002:
id: 2
name: En cours
is_closed: false
position: 2
issue_statuses_003:
id: 3
name: Fait/A tester
is_closed: false
position: 3
issue_statuses_004:
name: Feedback
id: 4
is_closed: false
position: 4
issue_statuses_005:
id: 5
name: Fermé
is_closed: true
position: 5
issue_statuses_006:
id: 6
name: Rejeté
is_closed: true
position: 6
151 changes: 151 additions & 0 deletions test/fixtures/issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
---
issues_001:
created_on: <%= 3.days.ago.to_s(:db) %>
project_id: 1
updated_on: <%= 1.day.ago.to_s(:db) %>
priority_id: 1
subject: Can't print recipes
id: 1
fixed_version_id:
category_id: 1
description: Unable to print recipes
tracker_id: 1
assigned_to_id:
author_id: 4
status_id: 1
start_date: <%= 1.day.ago.to_date.to_s(:db) %>
due_date: <%= 10.day.from_now.to_date.to_s(:db) %>
root_id: 1
lft: 1
rgt: 2
lock_version: 3

issues_002:
created_on: <%= 3.days.ago.to_s(:db) %>
project_id: 2
updated_on: <%= 1.day.ago.to_s(:db) %>
priority_id: 1
subject: Can't print anything
id: 2
fixed_version_id:
category_id: 1
description: Unable to print recipes
tracker_id: 1
assigned_to_id:
author_id: 4
status_id: 1
start_date: <%= 1.day.ago.to_date.to_s(:db) %>
due_date: <%= 10.day.from_now.to_date.to_s(:db) %>
root_id: 1
lft: 1
rgt: 2
lock_version: 3

issues_003:
created_on: <%= 3.days.ago.to_s(:db) %>
project_id: 2
updated_on: <%= 1.day.ago.to_s(:db) %>
priority_id: 1
subject: Can't print anything
id: 3
fixed_version_id:
category_id: 1
description: Unable to print recipes
tracker_id: 1
assigned_to_id:
author_id: 4
status_id: 2
start_date: <%= 1.day.ago.to_date.to_s(:db) %>
due_date: <%= 10.day.from_now.to_date.to_s(:db) %>
root_id: 1
parent_id: 2
lft: 1
rgt: 2
lock_version: 3

issues_004:
created_on: <%= 3.days.ago.to_s(:db) %>
project_id: 2
updated_on: <%= 1.day.ago.to_s(:db) %>
priority_id: 1
subject: Can't print anything
id: 4
fixed_version_id:
category_id: 1
description: Unable to print recipes
tracker_id: 1
assigned_to_id:
author_id: 4
status_id: 2
start_date: <%= 1.day.ago.to_date.to_s(:db) %>
due_date: <%= 10.day.from_now.to_date.to_s(:db) %>
root_id: 1
parent_id: 3
lft: 1
rgt: 2
lock_version: 3

issues_005:
created_on: <%= 3.days.ago.to_s(:db) %>
project_id: 2
updated_on: <%= 1.day.ago.to_s(:db) %>
priority_id: 1
subject: Can't print anything
id: 5
fixed_version_id:
category_id: 1
description: Unable to print recipes
tracker_id: 1
assigned_to_id:
author_id: 4
status_id: 2
start_date: <%= 1.day.ago.to_date.to_s(:db) %>
due_date: <%= 10.day.from_now.to_date.to_s(:db) %>
root_id: 1
parent_id: 4
lft: 1
rgt: 2
lock_version: 3

issues_006:
created_on: <%= 3.days.ago.to_s(:db) %>
project_id: 2
updated_on: <%= 1.day.ago.to_s(:db) %>
priority_id: 1
subject: Can't print anything
id: 6
fixed_version_id:
category_id: 1
description: Unable to print recipes
tracker_id: 1
assigned_to_id:
author_id: 4
status_id: 2
start_date: <%= 1.day.ago.to_date.to_s(:db) %>
due_date: <%= 10.day.from_now.to_date.to_s(:db) %>
root_id: 1
parent_id: 4
lft: 1
rgt: 2
lock_version: 3

issues_007:
created_on: <%= 3.days.ago.to_s(:db) %>
project_id: 2
updated_on: <%= 1.day.ago.to_s(:db) %>
priority_id: 1
subject: Can't print anything
id: 7
fixed_version_id: 8
category_id: 1
description: Unable to print recipes
tracker_id: 1
assigned_to_id:
author_id: 4
status_id: 2
start_date: <%= 1.day.ago.to_date.to_s(:db) %>
due_date: <%= 10.day.from_now.to_date.to_s(:db) %>
root_id: 1
lft: 1
rgt: 2
lock_version: 3
5 changes: 5 additions & 0 deletions test/fixtures/member_roles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
member_roles_001:
id: 1
role_id: 1
member_id: 1
7 changes: 7 additions & 0 deletions test/fixtures/members.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
members_001:
created_on: 2006-07-19 19:35:33 +02:00
project_id: 1
id: 1
user_id: 2
mail_notification: false
13 changes: 13 additions & 0 deletions test/fixtures/projects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

test_project:
id: 1
name: test_project
is_public: false
lft: 1
rgt: 2

project_002:
id: 2
name: my project
lft: 1
rgt: 2
Loading

0 comments on commit 60567bb

Please sign in to comment.