Top Menu

Jump to content
Home
    • Projects
    • Work packages
    • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Professional support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?
      Create a new account

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
  • Roadmap
  • Work packages
  • Calendars
  • Team planners
  • Boards
  • Forums
  • Wiki
    • Table of contents
      • Expanded. Click to collapseCollapsed. Click to showDeveloper
        • Hierarchy leafAccessibility Checklist
        • Hierarchy leafCode Review Guidelines
        • Expanded. Click to collapseCollapsed. Click to showContribution
          • Hierarchy leafGit Workflow
          • Hierarchy leafTranslations
        • Expanded. Click to collapseCollapsed. Click to showDeveloping Plugins
          • Hierarchy leafDeveloping an OmniAuth Authentication Plugin
        • Hierarchy leafRelease Process
        • Hierarchy leafReport a bug
        • Hierarchy leafSecurity
        • Hierarchy leafSetting up an OpenLDAP server for testing
        • Hierarchy leafTheme Features
      • Hierarchy leafDownload
      • Expanded. Click to collapseCollapsed. Click to showFeature tour
        • Hierarchy leafRelease Notes OpenProject 30
        • Expanded. Click to collapseCollapsed. Click to showRelease Notes OpenProject 30 - Overview
          • Hierarchy leafGlossary
          • Hierarchy leafRelease Notes - Accessibility
          • Hierarchy leafRelease Notes - Accessibility changes
          • Hierarchy leafRelease Notes - Add work package queries as menu items to sidebar
          • Hierarchy leafRelease Notes - Copy projects based on Templates
          • Hierarchy leafRelease Notes - Design changes
          • Hierarchy leafRelease Notes - Fixed Bugs
          • Hierarchy leafRelease Notes - Keyboard Shortcuts
          • Hierarchy leafRelease Notes - Project settings
          • Hierarchy leafRelease Notes - Ruby&Rails Update
          • Hierarchy leafRelease Notes - Security
          • Hierarchy leafRelease Notes - Timelines
          • Hierarchy leafRelease Notes - Work packages
      • Hierarchy leafHowto create animated gifs
      • Hierarchy leafMigration Squashing
      • Hierarchy leafMod security
      • Hierarchy leafNew work package page
      • Hierarchy leafOP3 to OP4 Debian upgrade
      • Hierarchy leafOP4 Ubuntu1404 Stable with MySQL in production
      • Hierarchy leafOpenProject 40 Development Setup
      • Expanded. Click to collapseCollapsed. Click to showOpenProject Foundation
        • Hierarchy leafBoards
        • Hierarchy leafMembers
        • Hierarchy leafOPF-Meetings
        • Hierarchy leafStatutes
      • Expanded. Click to collapseCollapsed. Click to showRelease Notes
        • Hierarchy leafOpenProject released on Bitnami
      • Expanded. Click to collapseCollapsed. Click to showRelease Notes OpenProject 40 - Overview
        • Hierarchy leafRelease Notes OpenProject 40 - Accessibility improvements
        • Hierarchy leafRelease Notes OpenProject 40 - Column header functions in work package table
        • Hierarchy leafRelease Notes OpenProject 40 - Improved Design
        • Hierarchy leafRelease Notes OpenProject 40 - Integrated query title on work package page
        • Hierarchy leafRelease Notes OpenProject 40 - Integrated toolbar on work package page
        • Hierarchy leafRelease Notes OpenProject 40 - OmniAuth integration for OpenProject
        • Hierarchy leafRelease Notes OpenProject 40 - Work package details pane
      • Expanded. Click to collapseCollapsed. Click to showSecurity and privacy
        • Hierarchy leafFAQ
      • Expanded. Click to collapseCollapsed. Click to showSupport
        • Expanded. Click to collapseCollapsed. Click to showDownload and Installation
          • Hierarchy leafInstallation MacOS
          • Expanded. Click to collapseCollapsed. Click to showInstallation OpenProject 3 0
            • Hierarchy leafDebian Stable with MySQL in production
            • Hierarchy leafInstallation Ubuntu
            • Hierarchy leafInstallation Windows
            • Hierarchy leafInstallation on Centos 65 x64 with Apache and PostgreSQL 93
          • Expanded. Click to collapseCollapsed. Click to showInstallation OpenProject 40
            • Hierarchy leafOP4 Debian Stable with MySQL in production
          • Expanded. Click to collapseCollapsed. Click to showMigration paths
            • Hierarchy leafFrom Chilliproject to OpenProject
            • Hierarchy leafMigration 15 to 30
            • Hierarchy leafMigration 24 to 30
            • Hierarchy leafMigration Redmine 2x › OpenProject 30
            • Hierarchy leafOpenProject 3 Migration
          • Hierarchy leafOpenProject 40
        • Expanded. Click to collapseCollapsed. Click to showNews
          • Hierarchy leafNew OpenProject Translations Plugin
          • Hierarchy leafNew Plugin on OpenProjectorg Local Avatars
          • Hierarchy leafNew design for OpenProject
          • Hierarchy leafNews Accessibility workshop for OpenProject
          • Hierarchy leafNews Glossary for OpenProject
          • Hierarchy leafNews Heartbleed fixed
          • Hierarchy leafNews Icon Fonts
          • Hierarchy leafNews OpenProject 30 Release
          • Hierarchy leafNews Release GitHub Integration Plugin
          • Hierarchy leafNews Success Story Deutsche Telekom
          • Hierarchy leafNews Timelines
          • Hierarchy leafOpenProject 3013 released
          • Hierarchy leafOpenProject 3017 released
          • Hierarchy leafOpenProject 40 released
          • Hierarchy leafOpenProject 40 will be coming soon
          • Hierarchy leafOpenProject 405 released
          • Hierarchy leafOpenProject and pkgrio
          • Hierarchy leafOpenProject news moved to a new blog
          • Hierarchy leafOpenProjectBitnami
          • Hierarchy leafPackager version with plugins released ("Community edition")
          • Hierarchy leafRegistration OpenProject-Foundation
          • Hierarchy leafRelease OpenProject AuthPlugins
          • Hierarchy leafUpdates on OpenProject
          • Hierarchy leafWe need your feedback for the the new fullscreen view for work packages
        • Hierarchy leafOpenProject Plug-Ins
      • Hierarchy leafWiki
You are here:
  • Forums
  • Development

Content

Adding new block in "My Page"

Added by Jörg Delker almost 8 years ago

My environment: OpenProject 4.0.6 (installed on CentOS 6 from provided openproject-ce package)

I would like to add a new customized block to the available blocks list in “My Page”.
As suggested in EDITING PLUGINS, I followed the advise to copy the openproject-my_project_page plugin from ./vendored-plugins to ./plugins to add my customizations.

Unfortunately, I’m not successful to see any of my changes become active.
That may because I’m simply doing something fundamental wrong…

This is what I did:

  1. copy ./vendored-plugins/openproject-my_project_page to ./plugins
  2. changed the plugin entry in Gemfiles.plugins to gem "openproject-my_project_page", :path => "plugins/openproject-my_project_page"
  3. added a new block as plugins/openproject-my_project_page/app/views/my_projects_overviews/blocks/_work_packages_waiting_for_me.html.erb
  4. added locale entries for label_work_packages_waiting_for_me to config/locales/*.yml

Then I invoked

  1. openproject-ce run bundle install --no-deployment
  2. service openproject-ce restart

After that I would’ve expected to see the added block in the MyPage Edit Page (/my/page_layout).
But that’s not the case. Actually, nothing changed at all.

What am I doing wrong here?

Cheers
Jörg


Replies (4)

RE: Adding new block in "My Page" - Added by Jonas Heinrich (Finn) almost 8 years ago

H Jörg,

I think you have the .erb in the wrong path. It should be: vendored-plugins/openproject-my_project_page/app/views/my/blocks/ (‘my’ instead of ‘my_projects_overviews’).

Furthermore, you could check if your version of the plugin is used via openproject-ce run bundle show openproject-my_project_page.

And finally, if you think that this block is a good piece of code you could create a pull request against our github-repository. We are happy about every contribution. :)

Best,

Jonas

RE: Adding new block in "My Page" - Added by Jörg Delker almost 8 years ago

Hi Jonas,

thanks for responding and the good hint.

Unfortunately, there is no documentation on development of custom content-blocks, so some reverse engineering was necessary.
(Which is kind of hard, with very limited ruby background…)

While I figured from one of the vendered plugin code elements that custom content-blocks for the “project overview” page are expected in app/views/my_project_overviews/blocks/_my_custom_block.erb, I didn’t find the code that looks for the “My page” content blocks.

However, you gave the hint to place those in app/views/my/blocks/_my_custom_block.erb, which worked perfectly.

My code is available here.
Pull request is coming up.

Disclaimer: This is my 1st ruby code so far, so bare with me. It purely results from looking at other code and counting 1 and 1 together.
If this could be implemented much more elegant, feel free to fork and improve - I like to learn from that!

RE: Adding new block in "My Page" - Added by Jonas Heinrich (Finn) almost 8 years ago

Hi Jörg,

yes, it is unfortunately that we do not have enough documentation. We try to fix that. Or, if you have mastered this riddle by now, you could create a short documentation. :)

Btw, your code looks good to me so far :+1:

I think I now found out what is the main cause for (my) confusion: There is a difference between my-project-page and the my-page. You probably know the following. But to be sure I just write it down again.

  • The my-page is sort of global and shows information about your account.
  • Whereas the my-project-page is bound to a project. That means that a block that is added in app/views/my_project_overviews/blocks will be selectable when you personalize a project page. To see this, go to a project and click personalize this page on the upper right.

That leads to the following places to store blocks:

  • Blocks for my-page in my/blocks (see the code here)
  • Blocks for my-project-page in my_project_overview/blocks (see the code here)

Unfortunately, if you want to create pull request then you can only create one against OpenProject or against OpenProject-My_Project_Overview. So you would have to split your repository up. You can find a more detailed explanation here. That way, your blocks would automatically be in the community edition.

Or maybe you want to add this as it is: as a plugin. But right now, I’m not sure how we would handle it. We are thinking about doing more with rubygems.

So it may be possible to kind of release it as a plugin. But for now it would be easier to include into the existing repositories. What do you think?

Best,

Jonas

RE: Adding new block in "My Page" - Added by Jörg Delker almost 8 years ago

Hi Jonas,

thanks for summarizing the facts again. I recon that we had the same “confusion” here ;)

And thanks again for your mind-reading about the pull request. I’ve broke my head about that exact problem.

For now, I decided to leave this as a single external plugin and postpone the pull request.
In it’s current state, the code would probably not fit very well in the community edition anyhow, because the type of workpackages that are evaluated is hard-coded (due to my lack of knowledge how to implement a plugin config page yet).

As soon as I’ve found a clue on that and made that types configurable, I’ll probably fork the particular community-edition repos and transplant the code.
Then a pull request will be easy.

Thanks for your support,

Jörg

  • (1 - 4/4)
Loading...