SlideShare une entreprise Scribd logo
1  sur  26
Redmine




2010   4   29             1
Hatena id:suer
           Twitter @suer

           Redmine Plugin: MSP Importer (   ...)
                   :
                                                     24

                                            ocaml-nagoya




   -[ ]-
2010   4    29                                             2
Redmine
                                Rails


                                Web

                  feed   wiki



       SCM

   -[ ]-
2010   4   29                           3
-[ ]-
2010   4   29   4
-[ ]-
2010   4   29   5
TiDD   !
                           !

   -[ ]-
2010   4   29                  6
-[ ]-
2010   4   29   7
Coder
   -[ ]-
2010   4   29           8
Rails



   -[ ]-
2010   4   29           9
Redmine0.9




   -[ ]-
2010   4   29                10
Redmine1.0(7                                     )




                http://www.redmine.org/news/36

   -[ ]-
2010   4   29                                    11
...




   -[ ]-
2010   4   29         12
conflict   (^o^)


   -[ ]-
2010   4   29                      13
-[ ]-
2010   4   29   14
Redmine




                  rhtml
       ViewHook

   -[ ]-
2010   4   29             15
ViewHook

                           ↓
http://d.hatena.ne.jp/suer/20100119/redmine_view_ext




   -[ ]-
2010   4   29                                          16
ViewHook
View                           call_hook
                 HTML                Lisnter
(       ) app/views/users/show.rhtml
 <%= call_hook :view_account_left_bottom, :user => @user %>
 <%= call_hook :view_account_right_bottom, :user => @user %>




    -[ ]-
2010   4    29                                                17
Hook
       :view                        ViewHook
 $ rake redmine:plugins:hook_list
 (    )
 app/views/users/show.rhtml:
   * [ 32] :view_account_left_bottom, :user => @user
   * [ 67] :view_account_right_bottom, :user => @user
 (      )



   -[ ]-
2010   4   29                                           18
-[ ]-
2010   4   29   19
$ ruby script/generate redmine_plugin AccountTichets
     create vendor/plugins/redmine_account_tichets/app/controllers
     create vendor/plugins/redmine_account_tichets/app/helpers
     create vendor/plugins/redmine_account_tichets/app/models
     create vendor/plugins/redmine_account_tichets/app/views
     create vendor/plugins/redmine_account_tichets/db/migrate
     create vendor/plugins/redmine_account_tichets/lib/tasks
     create vendor/plugins/redmine_account_tichets/assets/images
     create vendor/plugins/redmine_account_tichets/assets/javascripts
     create vendor/plugins/redmine_account_tichets/assets/stylesheets
     create vendor/plugins/redmine_account_tichets/lang
     create vendor/plugins/redmine_account_tichets/config/locales
     create vendor/plugins/redmine_account_tichets/test
     create vendor/plugins/redmine_account_tichets/README.rdoc
     create vendor/plugins/redmine_account_tichets/init.rb
     create vendor/plugins/redmine_account_tichets/lang/en.yml
     create vendor/plugins/redmine_account_tichets/config/locales/en.yml
     create vendor/plugins/redmine_account_tichets/test/test_helper.rb
   -[ ]-
2010   4   29                                                              20
ViewListener
       vender/plugins/redmine_account_tichets/lib/account_listener.rb

            class AccountListener < Redmine::Hook::ViewListener
             def view_account_left_bottom(context)            :view_account_left_bottom
               user = context[:user]
               assigned_issues = Issue.visible.open.find(:all,
                            :conditions => {:assigned_to_id => User.current.id})
               reported_issues = Issue.visible.find(:all,
                            :conditions => {:author_id => User.current.id })
               html = ''
               html << '<h3>Tickets</h3><ul>'
               html << '<li>assigned: ' + assigned_issues.size.to_s + ' Tickets</li>'
               html << '<li>reported: ' + reported_issues.size.to_s + ' Tickets</li>'
               html << '</ul>'
               html
             end
            end


   -[ ]-
2010    4    29                                                                           21
ViewListener
                    vender/plugins/redmine_account_tichets/init.rb
                require 'redmine'
                require 'account_listener' #

                Redmine::Plugin.register :redmine_account_tichets do
                 name 'Redmine Account Tichets plugin'
                 author 'Author name'
                 description 'This is a plugin for Redmine'
                 version '0.0.1'
                end




   -[ ]-
2010   4   29                                                          22
-[ ]-
2010   4   29   23
Redmine::Hook::Listener

                class Listener
                   include Singleton
                   include Redmine::I18n

                   # Registers the listener
                   def self.inherited(child)
                    Redmine::Hook.add_listener(child)
                    super
                   end

                end

   -[ ]-
2010   4   29                                           24
inherited
                     ^o^

   -[ ]-
2010   4   29               25
-[ ]-
2010   4   29   26

Contenu connexe

Similaire à Redmine本体に手を入れないビューカスタマイズ法あれこれ (Mitaka.rb #8)

Avoiding the domino effect in our [micro]services (SOLID at macro-design level)
Avoiding the domino effect in our [micro]services (SOLID at macro-design level)Avoiding the domino effect in our [micro]services (SOLID at macro-design level)
Avoiding the domino effect in our [micro]services (SOLID at macro-design level)CodelyTV
 
Architecting your Frontend
Architecting your FrontendArchitecting your Frontend
Architecting your FrontendRuben Teijeiro
 
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015Innomatic Platform
 
Openmiconwhatsnewindomino9socialedition 130411102852-phpapp01
Openmiconwhatsnewindomino9socialedition 130411102852-phpapp01Openmiconwhatsnewindomino9socialedition 130411102852-phpapp01
Openmiconwhatsnewindomino9socialedition 130411102852-phpapp01Ranjit Rai
 
Web Components: back to the future
Web Components: back to the futureWeb Components: back to the future
Web Components: back to the futureDA-14
 
Bp307 Practical Solutions for Connections Administrators, tips and scrips for...
Bp307 Practical Solutions for Connections Administrators, tips and scrips for...Bp307 Practical Solutions for Connections Administrators, tips and scrips for...
Bp307 Practical Solutions for Connections Administrators, tips and scrips for...Sharon James
 
Integrating DDS into AXCIOMA, the component approach
Integrating DDS into AXCIOMA, the component approachIntegrating DDS into AXCIOMA, the component approach
Integrating DDS into AXCIOMA, the component approachRemedy IT
 
Working With The Symfony Admin Generator
Working With The Symfony Admin GeneratorWorking With The Symfony Admin Generator
Working With The Symfony Admin GeneratorJohn Cleveley
 
MicroProfile Starterで簡単スタート Open Liberty
MicroProfile Starterで簡単スタート Open LibertyMicroProfile Starterで簡単スタート Open Liberty
MicroProfile Starterで簡単スタート Open LibertyTakakiyo Tanaka
 
WordPress customizer: for themes and more
WordPress customizer: for themes and moreWordPress customizer: for themes and more
WordPress customizer: for themes and moreR-Cubed Design Forge
 
PHP QA Tools
PHP QA ToolsPHP QA Tools
PHP QA Toolsrjsmelo
 
IBM Connect Switzerland - Der entspannte Administrator
IBM Connect Switzerland - Der entspannte AdministratorIBM Connect Switzerland - Der entspannte Administrator
IBM Connect Switzerland - Der entspannte AdministratorKlaus Bild
 
MuleSoft Surat Live Demonstration Virtual Meetup#3 - Building JWT OAuth 2.0 C...
MuleSoft Surat Live Demonstration Virtual Meetup#3 - Building JWT OAuth 2.0 C...MuleSoft Surat Live Demonstration Virtual Meetup#3 - Building JWT OAuth 2.0 C...
MuleSoft Surat Live Demonstration Virtual Meetup#3 - Building JWT OAuth 2.0 C...Jitendra Bafna
 
AD303 - Extreme Makeover: IBM Lotus Domino Application Edition
AD303 - Extreme Makeover: IBM Lotus Domino Application EditionAD303 - Extreme Makeover: IBM Lotus Domino Application Edition
AD303 - Extreme Makeover: IBM Lotus Domino Application EditionRay Bilyk
 
[CB20] LogonTracer v1.5 + Elasticsearch = Real-time AD Log Analysis System by...
[CB20] LogonTracer v1.5 + Elasticsearch = Real-time AD Log Analysis System by...[CB20] LogonTracer v1.5 + Elasticsearch = Real-time AD Log Analysis System by...
[CB20] LogonTracer v1.5 + Elasticsearch = Real-time AD Log Analysis System by...CODE BLUE
 
Integrating DDS into AXCIOMA - The Component Approach
Integrating DDS into AXCIOMA - The Component ApproachIntegrating DDS into AXCIOMA - The Component Approach
Integrating DDS into AXCIOMA - The Component ApproachReal-Time Innovations (RTI)
 

Similaire à Redmine本体に手を入れないビューカスタマイズ法あれこれ (Mitaka.rb #8) (20)

AdminKit
AdminKitAdminKit
AdminKit
 
Avoiding the domino effect in our [micro]services (SOLID at macro-design level)
Avoiding the domino effect in our [micro]services (SOLID at macro-design level)Avoiding the domino effect in our [micro]services (SOLID at macro-design level)
Avoiding the domino effect in our [micro]services (SOLID at macro-design level)
 
Your notes DNA
Your notes DNAYour notes DNA
Your notes DNA
 
Architecting your Frontend
Architecting your FrontendArchitecting your Frontend
Architecting your Frontend
 
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
Building Multi-Tenant and SaaS products in PHP - CloudConf 2015
 
Introduction to Linux Drivers
Introduction to Linux DriversIntroduction to Linux Drivers
Introduction to Linux Drivers
 
Openmiconwhatsnewindomino9socialedition 130411102852-phpapp01
Openmiconwhatsnewindomino9socialedition 130411102852-phpapp01Openmiconwhatsnewindomino9socialedition 130411102852-phpapp01
Openmiconwhatsnewindomino9socialedition 130411102852-phpapp01
 
Web Components: back to the future
Web Components: back to the futureWeb Components: back to the future
Web Components: back to the future
 
Bp307 Practical Solutions for Connections Administrators, tips and scrips for...
Bp307 Practical Solutions for Connections Administrators, tips and scrips for...Bp307 Practical Solutions for Connections Administrators, tips and scrips for...
Bp307 Practical Solutions for Connections Administrators, tips and scrips for...
 
Integrating DDS into AXCIOMA, the component approach
Integrating DDS into AXCIOMA, the component approachIntegrating DDS into AXCIOMA, the component approach
Integrating DDS into AXCIOMA, the component approach
 
Working With The Symfony Admin Generator
Working With The Symfony Admin GeneratorWorking With The Symfony Admin Generator
Working With The Symfony Admin Generator
 
MicroProfile Starterで簡単スタート Open Liberty
MicroProfile Starterで簡単スタート Open LibertyMicroProfile Starterで簡単スタート Open Liberty
MicroProfile Starterで簡単スタート Open Liberty
 
WordPress customizer: for themes and more
WordPress customizer: for themes and moreWordPress customizer: for themes and more
WordPress customizer: for themes and more
 
PHP QA Tools
PHP QA ToolsPHP QA Tools
PHP QA Tools
 
IBM Connect Switzerland - Der entspannte Administrator
IBM Connect Switzerland - Der entspannte AdministratorIBM Connect Switzerland - Der entspannte Administrator
IBM Connect Switzerland - Der entspannte Administrator
 
MuleSoft Surat Live Demonstration Virtual Meetup#3 - Building JWT OAuth 2.0 C...
MuleSoft Surat Live Demonstration Virtual Meetup#3 - Building JWT OAuth 2.0 C...MuleSoft Surat Live Demonstration Virtual Meetup#3 - Building JWT OAuth 2.0 C...
MuleSoft Surat Live Demonstration Virtual Meetup#3 - Building JWT OAuth 2.0 C...
 
AD303 - Extreme Makeover: IBM Lotus Domino Application Edition
AD303 - Extreme Makeover: IBM Lotus Domino Application EditionAD303 - Extreme Makeover: IBM Lotus Domino Application Edition
AD303 - Extreme Makeover: IBM Lotus Domino Application Edition
 
Django introduction
Django introductionDjango introduction
Django introduction
 
[CB20] LogonTracer v1.5 + Elasticsearch = Real-time AD Log Analysis System by...
[CB20] LogonTracer v1.5 + Elasticsearch = Real-time AD Log Analysis System by...[CB20] LogonTracer v1.5 + Elasticsearch = Real-time AD Log Analysis System by...
[CB20] LogonTracer v1.5 + Elasticsearch = Real-time AD Log Analysis System by...
 
Integrating DDS into AXCIOMA - The Component Approach
Integrating DDS into AXCIOMA - The Component ApproachIntegrating DDS into AXCIOMA - The Component Approach
Integrating DDS into AXCIOMA - The Component Approach
 

Redmine本体に手を入れないビューカスタマイズ法あれこれ (Mitaka.rb #8)

  • 1. Redmine 2010 4 29 1
  • 2. Hatena id:suer Twitter @suer Redmine Plugin: MSP Importer ( ...) : 24 ocaml-nagoya -[ ]- 2010 4 29 2
  • 3. Redmine Rails Web feed wiki SCM -[ ]- 2010 4 29 3
  • 4. -[ ]- 2010 4 29 4
  • 5. -[ ]- 2010 4 29 5
  • 6. TiDD ! ! -[ ]- 2010 4 29 6
  • 7. -[ ]- 2010 4 29 7
  • 8. Coder -[ ]- 2010 4 29 8
  • 9. Rails -[ ]- 2010 4 29 9
  • 10. Redmine0.9 -[ ]- 2010 4 29 10
  • 11. Redmine1.0(7 ) http://www.redmine.org/news/36 -[ ]- 2010 4 29 11
  • 12. ... -[ ]- 2010 4 29 12
  • 13. conflict (^o^) -[ ]- 2010 4 29 13
  • 14. -[ ]- 2010 4 29 14
  • 15. Redmine rhtml ViewHook -[ ]- 2010 4 29 15
  • 16. ViewHook ↓ http://d.hatena.ne.jp/suer/20100119/redmine_view_ext -[ ]- 2010 4 29 16
  • 17. ViewHook View call_hook HTML Lisnter ( ) app/views/users/show.rhtml <%= call_hook :view_account_left_bottom, :user => @user %> <%= call_hook :view_account_right_bottom, :user => @user %> -[ ]- 2010 4 29 17
  • 18. Hook :view ViewHook $ rake redmine:plugins:hook_list ( ) app/views/users/show.rhtml: * [ 32] :view_account_left_bottom, :user => @user * [ 67] :view_account_right_bottom, :user => @user ( ) -[ ]- 2010 4 29 18
  • 19. -[ ]- 2010 4 29 19
  • 20. $ ruby script/generate redmine_plugin AccountTichets create vendor/plugins/redmine_account_tichets/app/controllers create vendor/plugins/redmine_account_tichets/app/helpers create vendor/plugins/redmine_account_tichets/app/models create vendor/plugins/redmine_account_tichets/app/views create vendor/plugins/redmine_account_tichets/db/migrate create vendor/plugins/redmine_account_tichets/lib/tasks create vendor/plugins/redmine_account_tichets/assets/images create vendor/plugins/redmine_account_tichets/assets/javascripts create vendor/plugins/redmine_account_tichets/assets/stylesheets create vendor/plugins/redmine_account_tichets/lang create vendor/plugins/redmine_account_tichets/config/locales create vendor/plugins/redmine_account_tichets/test create vendor/plugins/redmine_account_tichets/README.rdoc create vendor/plugins/redmine_account_tichets/init.rb create vendor/plugins/redmine_account_tichets/lang/en.yml create vendor/plugins/redmine_account_tichets/config/locales/en.yml create vendor/plugins/redmine_account_tichets/test/test_helper.rb -[ ]- 2010 4 29 20
  • 21. ViewListener vender/plugins/redmine_account_tichets/lib/account_listener.rb class AccountListener < Redmine::Hook::ViewListener def view_account_left_bottom(context) :view_account_left_bottom user = context[:user] assigned_issues = Issue.visible.open.find(:all, :conditions => {:assigned_to_id => User.current.id}) reported_issues = Issue.visible.find(:all, :conditions => {:author_id => User.current.id }) html = '' html << '<h3>Tickets</h3><ul>' html << '<li>assigned: ' + assigned_issues.size.to_s + ' Tickets</li>' html << '<li>reported: ' + reported_issues.size.to_s + ' Tickets</li>' html << '</ul>' html end end -[ ]- 2010 4 29 21
  • 22. ViewListener vender/plugins/redmine_account_tichets/init.rb require 'redmine' require 'account_listener' # Redmine::Plugin.register :redmine_account_tichets do name 'Redmine Account Tichets plugin' author 'Author name' description 'This is a plugin for Redmine' version '0.0.1' end -[ ]- 2010 4 29 22
  • 23. -[ ]- 2010 4 29 23
  • 24. Redmine::Hook::Listener class Listener include Singleton include Redmine::I18n # Registers the listener def self.inherited(child) Redmine::Hook.add_listener(child) super end end -[ ]- 2010 4 29 24
  • 25. inherited ^o^ -[ ]- 2010 4 29 25
  • 26. -[ ]- 2010 4 29 26