官术网_书友最值得收藏!

  • Redmine Cookbook
  • Aleksandar Pavi?
  • 337字
  • 2021-07-16 09:44:50

Customizing the layout of the project entry page

If built-in customizations don't fit your needs and you need to edit Redmine's views manually for some reason, this recipe will show you how to make New project private in Redmine, and how to remove the Homepage field on the New project creation form.

Getting ready

Make sure that you have access to your working Redmine installation.

How to do it…

To accomplish the goal of making the project private by default by having the checkbox at the project creation form unchecked by default in Redmine, you need to navigate to Administration | Settings | Projects. Untick the New projects are public by default checkbox, and click Save.

To hide the Homepage textbox and label, use your favorite code editor with Ruby highlight, navigate with the file browser or via the command line to your Redmine installation folder, open redmine/app/views/projects/_form.html.erb, find the line containing <p><%= f.text_field :homepage, :size => 60 %></p>, and delete it. Restart Redmine and make sure that the creation of new projects change is reflected, as in the following screenshot:

How it works…

What we did here is deliberately combine built-in Redmine feature customization with code editing customization so that you learn to seek for built-in customizations before reaching out for the code editor. Therefore, first, we navigate to the Settings menu and disable the active checkbox for projects to be public. So, from now on, without restarting Redmine on a new project entry form, the Public checkbox will be unchecked by default. After this, we used a code editor and edited the app/views/projects/_form.html.erb file by removing the line that displays the Homepage field, and restarted Redmine to reflect this update.

There's more…

If you need to change the Issue entry form or any other form, you can use this same principle. Just find the view files that you need to edit, make the customization, restart Redmine, and view your change.

See also

Refer to the Starting and Restarting Redmine recipe from Chapter 5, Regular and Planned Maintenance.

主站蜘蛛池模板: 阿荣旗| 乌兰县| 镇赉县| 卓尼县| 佛冈县| 新沂市| 元江| 泰安市| 屯门区| 秦皇岛市| 和林格尔县| 宁河县| 公安县| 资阳市| 敖汉旗| 旌德县| 凤山县| 罗平县| 洛浦县| 丰台区| 噶尔县| 团风县| 洛南县| 定南县| 金平| 乡城县| 长沙县| 聊城市| 玉环县| 池州市| 白沙| 定襄县| 贵德县| 麻江县| 广宗县| 精河县| 乳山市| 呼伦贝尔市| 辽阳县| 新昌县| 永新县|