From 4665524ba2295238d9a647ad7cd40646cc06e6b9 Mon Sep 17 00:00:00 2001 From: Bernhard Furtmueller Date: Tue, 22 Sep 2009 16:33:43 +0200 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 | 5 +++-- 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, 44 insertions(+), 5 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 a66a86b..6515a6f 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -811,6 +811,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 9526087..eb56c5a 100644 --- a/config/locales/bs.yml +++ b/config/locales/bs.yml @@ -835,6 +835,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 7315b1c..790de07 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -814,6 +814,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 59e1b95..99b5345 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -817,6 +817,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 2453ec9..afdcb16 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -837,6 +837,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 da700a6..b32c71a 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -837,6 +837,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 0b30843..43e13f6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -311,6 +311,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 fd1a640..bb9f641 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -858,6 +858,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 b0e00b0..29ea871 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -847,6 +847,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 e6231e8..de33f9c 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -333,6 +333,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 f8aab4b..23ae4ca 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -837,6 +837,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 8124dda..8485f71 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -821,6 +821,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 58fa750..9f65412 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -842,6 +842,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 64d5daf..92ac620 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -824,6 +824,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 107f84a..dc146bc 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -339,6 +339,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 7b06e4a..bc539b6 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -366,9 +366,10 @@ ko: setting_repository_log_display_limit: 저장소 보기에 표시할 개정판 이력의 최대 갯수 setting_file_max_size_displayed: 바로 보여줄 텍스트파일의 최대 크기 setting_openid: OpenID 로그인과 등록 허용 - setting_password_min_length: 최소 암호 길이 +<<<<<<< HEAD:config/locales/ko.yml setting_new_project_user_role_id: 프로젝트를 만든 사용자에게 주어질 역할 - + setting_short_desc_length: Length of short project description +>>>>>>> d5f181f... Introducing a configurable length of the short project description.:config/locales/ko.yml permission_add_project: 프로젝트 생성 permission_edit_project: 프로젝트 편집 permission_select_project_modules: 프로젝트 모듈 선택 diff --git a/config/locales/lt.yml b/config/locales/lt.yml index 2c27f50..b70c797 100644 --- a/config/locales/lt.yml +++ b/config/locales/lt.yml @@ -847,6 +847,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 a53f767..e42ff7c 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -799,6 +799,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 fddcc2f..b462fee 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -812,6 +812,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 d7e4849..e1ec19c 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -840,6 +840,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 23e5718..5a8b6ca 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -845,6 +845,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 1c444f6..f27c9a8 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -832,6 +832,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 04eb985..fc25542 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -814,6 +814,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 2dd9b66..34a9d5f 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 6f3a641..119b4c3 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -816,6 +816,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 6881ac9..100ae8c 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -813,6 +813,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 1edc4e1..1f19928 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -832,6 +832,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 f17c64d..961bb2a 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -361,6 +361,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 98d3c3c..a765d09 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -814,6 +814,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 d721eeb..34132d3 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -847,6 +847,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 8209cc4..13d618b 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -813,6 +813,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 6952419..c4a30d3 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -876,6 +876,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 e9199c3..720ff49 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -402,6 +402,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 a064828..fe4e07d 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -333,6 +333,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.6.1.2