From a97d64c40e43413970115bc1166e483684ccab3f Mon Sep 17 00:00:00 2001 From: Henriette Dinger Date: Thu, 31 Mar 2016 15:10:48 +0200 Subject: [PATCH 1/4] Change styling of document overview --- .../stylesheets/documents/documents.css.erb | 16 ++++++++++++++++ app/views/documents/_document.html.erb | 4 ++-- app/views/documents/index.html.erb | 8 ++++++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/documents/documents.css.erb b/app/assets/stylesheets/documents/documents.css.erb index 4f0ee50abb..c27f4bf2ff 100644 --- a/app/assets/stylesheets/documents/documents.css.erb +++ b/app/assets/stylesheets/documents/documents.css.erb @@ -37,3 +37,19 @@ dt.document:before { .sidebar--document-sort label:last-of-type { margin-bottom: 2rem; } + +.document-category-elements { + display: inline; +} + +.document-category-elements--header { + margin-bottom: 0.25rem; +} + +.document-category-elements--date { + margin-bottom: 0.75rem; +} + +.document-category-elements .wiki { + margin-bottom: 2rem; +} diff --git a/app/views/documents/_document.html.erb b/app/views/documents/_document.html.erb index 54226e0e07..73b7f19846 100644 --- a/app/views/documents/_document.html.erb +++ b/app/views/documents/_document.html.erb @@ -30,8 +30,8 @@ See doc/COPYRIGHT.rdoc for more details. ++#%> -

<%= link_to h(document.title), :controller => '/documents', :action => 'show', :id => document %>

-

<%= format_time(document.updated_on) %>

+

<%= link_to h(document.title), :controller => '/documents', :action => 'show', :id => document %>

+

<%= format_time(document.updated_on) %>

<%= format_text(truncate_lines(document.description)) %> diff --git a/app/views/documents/index.html.erb b/app/views/documents/index.html.erb index c39e1d2d72..60a2145059 100644 --- a/app/views/documents/index.html.erb +++ b/app/views/documents/index.html.erb @@ -47,8 +47,12 @@ See doc/COPYRIGHT.rdoc for more details. <% end %> <% @grouped.keys.sort.each do |group| %> -

<%= group %>

- <%= render :partial => 'documents/document', :collection => @grouped[group] %> +
+ <%= group %> +
+ <%= render :partial => 'documents/document', :collection => @grouped[group] %> +
+
<% end %> <% content_for :sidebar do %> From 4b10a2f08d14d1227bd44768ba68918d4cd01ed0 Mon Sep 17 00:00:00 2001 From: Henriette Dinger Date: Fri, 1 Apr 2016 15:01:19 +0200 Subject: [PATCH 2/4] Add fieldset for better accessibility with screenreader --- app/views/documents/index.html.erb | 38 +++++++++++++++++------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/app/views/documents/index.html.erb b/app/views/documents/index.html.erb index c39e1d2d72..6bcafae811 100644 --- a/app/views/documents/index.html.erb +++ b/app/views/documents/index.html.erb @@ -52,24 +52,28 @@ See doc/COPYRIGHT.rdoc for more details. <% end %> <% content_for :sidebar do %> -

<%= l(:label_sort_by, '') %>

<%= form_tag({}, :method => :get, class: 'sidebar--document-sort') do %> -
-
-
- +
+ <%= l(:label_sort_by, '') %> +

+ <%= radio_button_tag 'sort_by', 'category', (@sort_by == 'category'), :onclick => 'this.form.submit();' %> +
+ <%= radio_button_tag 'sort_by', 'date', (@sort_by == 'date'), :onclick => 'this.form.submit();' %> +
+ <%= radio_button_tag 'sort_by', 'title', (@sort_by == 'title'), :onclick => 'this.form.submit();' %> +
+ <%= radio_button_tag 'sort_by', 'author', (@sort_by == 'author'), :onclick => 'this.form.submit();' %> + +

+
<% end %> <% end %> From 703f926bc0a6f793bc616908c9de63f480975510 Mon Sep 17 00:00:00 2001 From: Markus Kahl Date: Wed, 6 Apr 2016 18:00:54 +0100 Subject: [PATCH 3/4] Feature: seed document categories --- app/seeders/enumeration_seeder.rb | 50 +++++++++++++++++++++++++++++++ config/locales/en.yml | 5 ++++ 2 files changed, 55 insertions(+) create mode 100644 app/seeders/enumeration_seeder.rb diff --git a/app/seeders/enumeration_seeder.rb b/app/seeders/enumeration_seeder.rb new file mode 100644 index 0000000000..9d3129c27a --- /dev/null +++ b/app/seeders/enumeration_seeder.rb @@ -0,0 +1,50 @@ +#-- encoding: UTF-8 +#-- copyright +# OpenProject is a project management system. +# Copyright (C) 2012-2015 the OpenProject Foundation (OPF) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See doc/COPYRIGHT.rdoc for more details. +#++ + +module BasicData + module Documents + class EnumerationsSeeder < Seeder + def seed_data! + category_names.each do |name| + DocumentCategory.create name: name + end + end + + def category_names + category_i18n_keys.map { |key| I18n.t key } + end + + def category_i18n_keys + ['documentation', 'specification', 'other'].map do |name| + ['enumeration', 'document_category', name].join('.') + end + end + end + end +end diff --git a/config/locales/en.yml b/config/locales/en.yml index 4f73496115..da7569f40d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -38,6 +38,11 @@ en: default_doc_category_user: "User documentation" enumeration_doc_categories: "Document categories" + enumeration: + document_category: + documentation: Documentation + specification: Specification + other: Other label_document_added: "Document added" label_document_new: "New document" From 63acd7ff6e38abdaeac899a7ec997357e6dae9df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Mon, 11 Apr 2016 09:43:24 +0200 Subject: [PATCH 4/4] Bump VERSION to 5.0.18 --- lib/open_project/documents/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/open_project/documents/version.rb b/lib/open_project/documents/version.rb index 2985e74e95..2db9040a74 100644 --- a/lib/open_project/documents/version.rb +++ b/lib/open_project/documents/version.rb @@ -31,6 +31,6 @@ module OpenProject module Documents - VERSION = "5.0.17" + VERSION = "5.0.18" end end