From d5f181f47e9c4a5765c3ae76ad9b0b06cac7186d Mon Sep 17 00:00:00 2001 From: Redmine User Date: Tue, 22 Sep 2009 12:06:17 +0000 Subject: [PATCH] Introducing a configurable length of the short project description. If you have many project with long descriptions some overview pages get to long otherwise. --- app/helpers/projects_helper.rb | 2 +- app/views/admin/projects.rhtml | 2 +- app/views/settings/_general.rhtml | 3 +++ app/views/welcome/index.rhtml | 2 +- config/locales/bg.yml | 1 + config/locales/bs.yml | 1 + config/locales/ca.yml | 1 + config/locales/cs.yml | 1 + config/locales/da.yml | 1 + config/locales/de.yml | 1 + config/locales/en.yml | 1 + config/locales/es.yml | 1 + config/locales/fi.yml | 1 + config/locales/fr.yml | 1 + config/locales/gl.yml | 1 + config/locales/he.yml | 1 + config/locales/hu.yml | 1 + config/locales/it.yml | 1 + config/locales/ja.yml | 1 + config/locales/ko.yml | 1 + config/locales/lt.yml | 1 + config/locales/nl.yml | 1 + config/locales/no.yml | 1 + config/locales/pl.yml | 1 + config/locales/pt-BR.yml | 1 + config/locales/pt.yml | 1 + config/locales/ro.yml | 1 + config/locales/ru.yml | 1 + config/locales/sk.yml | 1 + config/locales/sl.yml | 1 + config/locales/sr.yml | 1 + config/locales/sv.yml | 1 + config/locales/th.yml | 1 + config/locales/tr.yml | 1 + config/locales/uk.yml | 1 + config/locales/vi.yml | 1 + config/locales/zh-TW.yml | 1 + config/locales/zh.yml | 1 + config/settings.yml | 2 ++ 39 files changed, 42 insertions(+), 3 deletions(-) diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 912450c..4b33544 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -60,7 +60,7 @@ module ProjectsHelper classes = (ancestors.empty? ? 'root' : 'child') s << "
  • " + link_to(h(project), {:controller => 'projects', :action => 'show', :id => project}, :class => "project #{User.current.member_of?(project) ? 'my-project' : nil}") - s << "
    #{textilizable(project.short_description, :project => project)}
    " unless project.description.blank? + s << "
    #{textilizable(project.short_description(Setting.short_desc_length), :project => project)}
    " unless project.description.blank? s << "
    \n" ancestors << project end diff --git a/app/views/admin/projects.rhtml b/app/views/admin/projects.rhtml index f5226bf..9cd9204 100644 --- a/app/views/admin/projects.rhtml +++ b/app/views/admin/projects.rhtml @@ -27,7 +27,7 @@ <% for project in @projects %> <%= css_project_classes(project) %>"> <%= project.active? ? link_to(h(project.name), :controller => 'projects', :action => 'settings', :id => project) : h(project.name) %> - <%= textilizable project.short_description, :project => project %> + <%= textilizable project.short_description(Setting.short_desc_length), :project => project %> <%= image_tag 'true.png' if project.is_public? %> <%= format_date(project.created_on) %> diff --git a/app/views/settings/_general.rhtml b/app/views/settings/_general.rhtml index f34161f..daa94c6 100644 --- a/app/views/settings/_general.rhtml +++ b/app/views/settings/_general.rhtml @@ -38,6 +38,9 @@

    <%= text_field_tag 'settings[diff_max_lines_displayed]', Setting.diff_max_lines_displayed, :size => 6 %>

    + +

    +<%= text_field_tag 'settings[short_desc_length]', Setting.short_desc_length, :size => 6 %>

    <%= submit_tag l(:button_save) %> diff --git a/app/views/welcome/index.rhtml b/app/views/welcome/index.rhtml index 021e330..0f54cd9 100644 --- a/app/views/welcome/index.rhtml +++ b/app/views/welcome/index.rhtml @@ -20,7 +20,7 @@ <% for project in @projects %>
  • <%= link_to h(project.name), :controller => 'projects', :action => 'show', :id => project %> (<%= format_time(project.created_on) %>) - <%= textilizable project.short_description, :project => project %> + <%= textilizable project.short_description(Setting.short_desc_length), :project => project %>
  • <% end %> diff --git a/config/locales/bg.yml b/config/locales/bg.yml index 90d7203..a268bd0 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -798,6 +798,7 @@ bg: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/bs.yml b/config/locales/bs.yml index 05b1cd7..a613a26 100644 --- a/config/locales/bs.yml +++ b/config/locales/bs.yml @@ -831,6 +831,7 @@ bs: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/ca.yml b/config/locales/ca.yml index 9e7b0b8..bb877a0 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -801,6 +801,7 @@ ca: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/cs.yml b/config/locales/cs.yml index c39f3e5..d230d88 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -804,6 +804,7 @@ cs: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/da.yml b/config/locales/da.yml index 9f18f6a..1b58dc7 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -831,6 +831,7 @@ da: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/de.yml b/config/locales/de.yml index b2157fc..7f465d4 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -830,6 +830,7 @@ de: mail_body_wiki_content_updated: "Die Wiki-Seite '{{page}}' wurde von {{author}} aktualisiert." permission_add_project: Erstelle Projekt setting_new_project_user_role_id: Rolle einem Nicht-Administrator zugeordnet, welcher ein Projekt erstellt + setting_short_desc_length: Länge der gekürzten Projektbeschreibung label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/en.yml b/config/locales/en.yml index d158007..1720ba4 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -294,6 +294,7 @@ en: setting_openid: Allow OpenID login and registration setting_password_min_length: Minimum password length setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description permission_add_project: Create project permission_edit_project: Edit project diff --git a/config/locales/es.yml b/config/locales/es.yml index fedf37d..0ee79fb 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -851,6 +851,7 @@ es: mail_body_wiki_content_updated: La página wiki '{{page}}' ha sido actualizada por {{author}}. permission_add_project: Crear proyecto setting_new_project_user_role_id: Permiso asignado a un usuario no-administrador para crear proyectos + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/fi.yml b/config/locales/fi.yml index 8a6678f..1827f47 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -841,6 +841,7 @@ fi: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 51483f7..a13d0bc 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -324,6 +324,7 @@ fr: setting_openid: "Autoriser l'authentification et l'enregistrement OpenID" setting_password_min_length: Longueur minimum des mots de passe setting_new_project_user_role_id: Rôle donné à un utilisateur non-administrateur qui crée un projet + setting_short_desc_length: Length of short project description permission_add_project: Créer un projet permission_edit_project: Modifier le projet diff --git a/config/locales/gl.yml b/config/locales/gl.yml index 3f93834..28089ad 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -830,6 +830,7 @@ gl: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/he.yml b/config/locales/he.yml index bf82d0c..e93b034 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -813,6 +813,7 @@ he: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/hu.yml b/config/locales/hu.yml index 2418101..0e3a3df 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -836,6 +836,7 @@ mail_body_wiki_content_updated: A '{{page}}' wiki oldalt {{author}} frissítette. permission_add_project: Projekt létrehozása setting_new_project_user_role_id: Projekt létrehozási jog nem adminisztrátor felhasználóknak + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/it.yml b/config/locales/it.yml index a5dabc5..2f4b5ea 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -816,6 +816,7 @@ it: mail_body_wiki_content_updated: La pagina '{{page}}' wiki è stata aggiornata da{{author}}. permission_add_project: Crea progetto setting_new_project_user_role_id: Ruolo assegnato agli utenti non amministratori che creano un progetto + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 633ee7b..d582201 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -329,6 +329,7 @@ ja: setting_openid: OpenIDによるログインと登録 setting_password_min_length: パスワードの最低必要文字数 setting_new_project_user_role_id: 管理者以外のユーザが作成したプロジェクトに設定するロール + setting_short_desc_length: Length of short project description permission_add_project: プロジェクトの追加 permission_edit_project: プロジェクトの編集 diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 6d9a53e..65e4317 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -355,6 +355,7 @@ ko: setting_openid: OpenID 로그인과 등록 허용 setting_password_min_length: 최소 암호 길이 setting_new_project_user_role_id: 프로젝트를 만든 일반사용자에게 주어질 권한 + setting_short_desc_length: Length of short project description permission_add_project: 프로젝트 생성 permission_edit_project: 프로젝트 편집 diff --git a/config/locales/lt.yml b/config/locales/lt.yml index 8280e15..1e237aa 100644 --- a/config/locales/lt.yml +++ b/config/locales/lt.yml @@ -841,6 +841,7 @@ lt: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 67f2ae3..e65bada 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -786,6 +786,7 @@ nl: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/no.yml b/config/locales/no.yml index 93ec683..8b9d72f 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -803,6 +803,7 @@ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/pl.yml b/config/locales/pl.yml index ea02687..b3ff388 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -834,6 +834,7 @@ pl: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index c9db913..33d8a6f 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -838,6 +838,7 @@ pt-BR: mail_body_wiki_content_updated: A página wiki '{{page}}' foi atualizada por {{author}}. permission_add_project: Criar projeto setting_new_project_user_role_id: Papel dado a um usuário não administrador que crie um projeto + setting_short_desc_length: Length of short project description label_view_all_revisions: Ver todas as revisões label_tag: Etiqueta label_branch: Ramo diff --git a/config/locales/pt.yml b/config/locales/pt.yml index 1ff51f8..e6ba658 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -822,6 +822,7 @@ pt: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/ro.yml b/config/locales/ro.yml index 24f961f..e830450 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -801,6 +801,7 @@ ro: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 79c4d82..39dfe86 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -928,6 +928,7 @@ ru: mail_body_wiki_content_updated: "{{author}} обновил(а) wiki-страницу '{{page}}'." permission_add_project: Создание проекта setting_new_project_user_role_id: Роль, назначаемая пользователю, создавшему проект + setting_short_desc_length: Length of short project description label_view_all_revisions: Показать все ревизии label_tag: Метка label_branch: Ветвь diff --git a/config/locales/sk.yml b/config/locales/sk.yml index 4a4ae9a..319737a 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -803,6 +803,7 @@ sk: mail_body_wiki_content_updated: Wiki stránka '{{page}}' bola aktualizovaná užívateľom {{author}}. setting_repositories_encodings: Kódovanie repozitára setting_new_project_user_role_id: Rola dána non-admin užívateľovi, ktorý vytvorí projekt + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/sl.yml b/config/locales/sl.yml index 0e48166..c793021 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -800,6 +800,7 @@ sl: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/sr.yml b/config/locales/sr.yml index b781019..b44c139 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -824,6 +824,7 @@ mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/sv.yml b/config/locales/sv.yml index b6601a9..7e29681 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -350,6 +350,7 @@ sv: setting_openid: Tillåt inloggning och registrering med OpenID setting_password_min_length: Minsta tillåtna lösenordslängd setting_new_project_user_role_id: Tilldelad roll för en icke-administratör som skapar ett projekt + setting_short_desc_length: Length of short project description permission_add_project: Skapa projekt permission_edit_project: Ändra projekt diff --git a/config/locales/th.yml b/config/locales/th.yml index 073a327..30db305 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -801,6 +801,7 @@ th: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/tr.yml b/config/locales/tr.yml index a189ab0..3df21a7 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -837,6 +837,7 @@ tr: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/uk.yml b/config/locales/uk.yml index b6e5539..1274073 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -800,6 +800,7 @@ uk: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/vi.yml b/config/locales/vi.yml index 378c31e..519e126 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -870,6 +870,7 @@ vi: mail_body_wiki_content_updated: The '{{page}}' wiki page has been updated by {{author}}. permission_add_project: Create project setting_new_project_user_role_id: Role given to a non-admin user who creates a project + setting_short_desc_length: Length of short project description label_view_all_revisions: View all revisions label_tag: Tag label_branch: Branch diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index a81a3ab..c452302 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -399,6 +399,7 @@ setting_openid: 允許使用 OpenID 登入與註冊 setting_password_min_length: 密碼最小長度 setting_new_project_user_role_id: 管理者以外之用戶建立新專案時,將被指派的角色 + setting_short_desc_length: Length of short project description permission_add_project: 建立專案 permission_edit_project: 編輯專案 diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 8faaec0..ce39cb6 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -324,6 +324,7 @@ zh: setting_openid: 允许使用OpenID登录和注册 setting_password_min_length: 最短密码长度 setting_new_project_user_role_id: 非管理员用户新建项目时将被赋予的(在该项目中的)角色 + setting_short_desc_length: Length of short project description permission_add_project: 新建项目 permission_edit_project: 编辑项目 diff --git a/config/settings.yml b/config/settings.yml index e0950c5..246bb22 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -157,3 +157,5 @@ gravatar_enabled: default: 0 openid: default: 0 +short_desc_length: + default: 255 -- 1.5.4.7