From f4df0b124ab3a212cf032b1add5242bbeb5d63ac Mon Sep 17 00:00:00 2001 From: Magdalena Kafka Date: Tue, 8 Dec 2015 12:32:23 +0100 Subject: [PATCH] Introduce styles for generic-lists * Replace definition lists with ul tags on activities --- app/assets/stylesheets/_misc_legacy.sass | 21 +------ app/assets/stylesheets/content/_list.lsg | 49 +++++++++++++++++ app/assets/stylesheets/content/_list.sass | 67 +++++++++++++++++++++++ app/assets/stylesheets/default.css.sass | 1 + app/views/activities/index.html.erb | 32 ++++++----- 5 files changed, 135 insertions(+), 35 deletions(-) create mode 100644 app/assets/stylesheets/content/_list.lsg create mode 100644 app/assets/stylesheets/content/_list.sass diff --git a/app/assets/stylesheets/_misc_legacy.sass b/app/assets/stylesheets/_misc_legacy.sass index b6324356c2..a918afe6ee 100644 --- a/app/assets/stylesheets/_misc_legacy.sass +++ b/app/assets/stylesheets/_misc_legacy.sass @@ -124,37 +124,21 @@ div p margin-top: 0 margin-bottom: 1em - &#activity dl - margin-left: 2em #search-results margin-left: 2em -div#activity dd, #search-results dd +#search-results dd margin-bottom: 1em padding-left: 18px font-size: 0.9em -div#activity - dt - &.me .time - border-bottom: 1px solid #999 - .time - color: #777 - font-size: 80% - dd .description - font-style: italic - #search-results dd .description font-style: italic div#activity span.project:after, #search-results span.project:after content: " -" -div#activity dd span.description - display: block - color: #808080 - #search-results dd span.description display: block @@ -325,9 +309,6 @@ input#user_search &.attributes .label font-weight: bold -#activity dt - clear: left - .journal-link float: right diff --git a/app/assets/stylesheets/content/_list.lsg b/app/assets/stylesheets/content/_list.lsg new file mode 100644 index 0000000000..773c2b6b81 --- /dev/null +++ b/app/assets/stylesheets/content/_list.lsg @@ -0,0 +1,49 @@ +# Generic lists + +``` + + +``` diff --git a/app/assets/stylesheets/content/_list.sass b/app/assets/stylesheets/content/_list.sass new file mode 100644 index 0000000000..7c3206e207 --- /dev/null +++ b/app/assets/stylesheets/content/_list.sass @@ -0,0 +1,67 @@ +//-- 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. +//++ + +.generic-list + margin: 0 + padding: 0 + + li + list-style: none + margin-bottom: 24px + + .title + font-weight: bold + + .icon-context:before + vertical-align: -2px + + .me + .time + border-bottom: 1px solid $gray-dark + + .time, + .description + color: $gray-dark + + .time, + .description, + .author + font-size: 0.9em + + .description, + .author + padding-left: 30px + + .description + font-style: italic + + .author + margin-bottom: 1em + + .avatar-mini + margin: 0 10px 0 0 diff --git a/app/assets/stylesheets/default.css.sass b/app/assets/stylesheets/default.css.sass index 318770945d..868acdbc41 100644 --- a/app/assets/stylesheets/default.css.sass +++ b/app/assets/stylesheets/default.css.sass @@ -71,6 +71,7 @@ @import content/attributes_table @import content/information_section @import content/widget_box +@import content/list @import content/work_package_details/activities_tab @import content/work_package_details/attachments_tab diff --git a/app/views/activities/index.html.erb b/app/views/activities/index.html.erb index 06e1c7392f..9660b01483 100644 --- a/app/views/activities/index.html.erb +++ b/app/views/activities/index.html.erb @@ -36,23 +36,25 @@ See doc/COPYRIGHT.rdoc for more details.
<% @events_by_day.keys.sort.reverse.each do |day| %>

<%= format_activity_day(day) %>

-
+
    <% @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%> -
    - <% event_type = e.event_type == 'meeting' ? 'meetings' : e.event_type %> - <% event_type = e.event_type == 'cost_object' ? 'budget' : event_type %> - <%= icon_wrapper("icon-context icon-#{event_type}", e.event_name) %> - <%= avatar(e.event_author) if e.respond_to?(:event_author) %> - <%= format_time(e.event_datetime.to_time, false) %> - <%= content_tag('span', link_to(e.project.name, e.project), class: 'project') if (@project.nil? || @project != e.project) && e.project %> - <%= link_to format_activity_title(e.event_title), e.event_path%> -
    -
    - <%= format_activity_description(e.event_description) %> - <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %> -
    +
  • +
    + <% event_type = e.event_type == 'meeting' ? 'meetings' : e.event_type %> + <% event_type = e.event_type == 'cost_object' ? 'budget' : event_type %> + <%= icon_wrapper("icon-context icon-#{event_type}", e.event_name) %> + <%= format_time(e.event_datetime.to_time, false) %> + <%= content_tag('span', link_to(e.project.name, e.project), class: 'project') if (@project.nil? || @project != e.project) && e.project %> + <%= link_to format_activity_title(e.event_title), e.event_path%> +
    +
    <%= format_activity_description(e.event_description) %>
    +
    + <%= avatar(e.event_author, {class: 'avatar-mini'}) if e.respond_to?(:event_author) %> + <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %> +
    +
  • <% end -%> -
+ <% end -%>