Merge pull request #2815 from myabc/feature/19574-QUICK-WIN-fieldset-styling

19574 Consolidate fieldset styling
pull/2825/head
Jan Sandbrink 10 years ago
commit da83d1bef9
  1. 1
      app/assets/javascripts/application.js.erb
  2. 27
      app/assets/javascripts/colors.js
  3. 2
      app/assets/javascripts/specific/toggable_fieldset.js
  4. 63
      app/assets/stylesheets/_misc_legacy.sass
  5. 51
      app/assets/stylesheets/content/_advanced_filters.sass
  6. 16
      app/assets/stylesheets/content/_boxes.sass
  7. 73
      app/assets/stylesheets/content/_forms.md
  8. 66
      app/assets/stylesheets/content/_forms.sass
  9. 1
      app/assets/stylesheets/content/_links.sass
  10. 16
      app/assets/stylesheets/content/_preview.md
  11. 11
      app/assets/stylesheets/content/_preview.sass
  12. 13
      app/assets/stylesheets/content/_simple_filters.sass
  13. 8
      app/assets/stylesheets/content/_tabular.sass
  14. 163
      app/assets/stylesheets/content/_timelines.scss
  15. 4
      app/assets/stylesheets/content/_wiki.md
  16. 2
      app/assets/stylesheets/default.css.sass
  17. 6
      app/assets/stylesheets/layout/_work_package.sass
  18. 5
      app/assets/stylesheets/open_project_global/_mixins.sass
  19. 1
      app/assets/stylesheets/open_project_global/_variables.sass
  20. 145
      app/helpers/timelines_helper.rb
  21. 4
      app/views/attachments/_nested_form.html.erb
  22. 2
      app/views/boards/show.html.erb
  23. 9
      app/views/common/preview.html.erb
  24. 4
      app/views/copy_projects/copy_from_settings.html.erb
  25. 4
      app/views/copy_projects/copy_settings/_copy_associations.html.erb
  26. 2
      app/views/messages/edit.html.erb
  27. 2
      app/views/messages/new.html.erb
  28. 2
      app/views/messages/show.html.erb
  29. 2
      app/views/news/edit.html.erb
  30. 2
      app/views/news/new.html.erb
  31. 2
      app/views/news/show.html.erb
  32. 2
      app/views/planning_element_type_colors/confirm_destroy.html.erb
  33. 2
      app/views/planning_element_type_colors/edit.html.erb
  34. 2
      app/views/planning_element_type_colors/index.html.erb
  35. 2
      app/views/planning_element_type_colors/new.html.erb
  36. 2
      app/views/project_associations/confirm_destroy.html.erb
  37. 2
      app/views/project_associations/edit.html.erb
  38. 2
      app/views/project_associations/index.html.erb
  39. 2
      app/views/project_associations/new.html.erb
  40. 6
      app/views/project_types/confirm_destroy.html.erb
  41. 2
      app/views/project_types/edit.html.erb
  42. 2
      app/views/project_types/index.html.erb
  43. 2
      app/views/project_types/new.html.erb
  44. 18
      app/views/projects/_form.html.erb
  45. 8
      app/views/projects/form/_custom_fields.html.erb
  46. 8
      app/views/projects/form/_modules.html.erb
  47. 10
      app/views/projects/form/_types.html.erb
  48. 2
      app/views/projects/settings/_types.html.erb
  49. 4
      app/views/reportings/_show.html.erb
  50. 2
      app/views/reportings/confirm_destroy.html.erb
  51. 6
      app/views/reportings/edit.html.erb
  52. 2
      app/views/reportings/index.html.erb
  53. 6
      app/views/reportings/new.html.erb
  54. 2
      app/views/reportings/show.html.erb
  55. 4
      app/views/timelines/_comparison.html.erb
  56. 4
      app/views/timelines/_general.html.erb
  57. 4
      app/views/timelines/_vertical_planning_elements.html.erb
  58. 15
      app/views/timelines/confirm_destroy.html.erb
  59. 2
      app/views/timelines/edit.html.erb
  60. 4
      app/views/timelines/filter/_planning_elements.html.erb
  61. 4
      app/views/timelines/filter/_projects.html.erb
  62. 4
      app/views/timelines/group/_grouping.html.erb
  63. 2
      app/views/timelines/new.html.erb
  64. 2
      app/views/types/index.html.erb
  65. 4
      app/views/versions/_work_package_counts.html.erb
  66. 4
      app/views/versions/show.html.erb
  67. 2
      app/views/wiki/edit.html.erb
  68. 2
      app/views/wiki/new.html.erb
  69. 2
      app/views/work_packages/_edit.html.erb
  70. 4
      app/views/work_packages/_form.html.erb
  71. 4
      app/views/work_packages/_time_entry.html.erb
  72. 4
      app/views/work_packages/calendars/index.html.erb
  73. 2
      app/views/work_packages/moves/new.html.erb
  74. 2
      app/views/work_packages/new.html.erb
  75. 2
      app/views/work_packages/show.html.erb
  76. 12
      app/views/workflows/edit.html.erb
  77. 3
      lib/open_project/text_formatting.rb
  78. 2
      spec/features/support/toggable_fieldsets.rb
  79. 67
      spec/lib/open_project/text_formatting_spec.rb

@ -46,6 +46,7 @@
//= require custom-fields
//= require date-range
//= require search
//= require colors
//source: http://stackoverflow.com/questions/8120065/jquery-and-prototype-dont-work-together-with-array-prototype-reverse
if (typeof []._reverse == 'undefined') {

@ -25,3 +25,30 @@
//
// See doc/COPYRIGHT.rdoc for more details.
//++
(function ($) {
$(function() {
$('.timelines-x-update-color').each(function() {
var preview, input, func, target;
preview = $(this);
target = preview.data('target');
if(target) {
input = $(target);
} else {
input = preview.next('input');
}
if (input.length === 0) {
return;
}
func = function () {
preview.css('background-color', input.val());
};
input.keyup(func).change(func).focus(func);
func();
});
});
}(jQuery));

@ -75,7 +75,7 @@ function toggleFieldset(el) {
}
jQuery(document).ready(function() {
jQuery('fieldset.header_collapsible').each(function(index) {
jQuery('fieldset.form--fieldset.-collapsible').each(function() {
var fieldset = getFieldset(this);
setFieldsetToggleState(fieldset);

@ -67,10 +67,6 @@
form
display: inline
fieldset
border: 1px solid #e4e4e4
margin: 0
hr
width: 100%
height: 1px
@ -207,8 +203,6 @@ div
margin-left: 16px
margin-bottom: 16px
background-color: #fff
fieldset
margin-bottom: 1em
.total-hours
text-align: right
@ -311,18 +305,6 @@ div#tab-content-members
input#user_search
width: 100%
* html div#tab-content-members fieldset div
height: 450px
div#tab-content-members fieldset div
&.select-boxes label
display: inline-block
width: 350px
/* max-width of select2boxes
&.select-boxes .select2-container
float: left
font-weight: normal
.quick_info
padding-bottom: 0.5em
&.attributes .label
@ -494,14 +476,6 @@ form#issue-list
#roadmap h3
margin: 21px 0 12px
div#roadmap fieldset.related-issues
margin: 12px 0
padding: 6px 12px
border-radius: 5px
#roadmap fieldset legend
font-style: italic
tr.context-menu-selection td.priority
background: none !important
@ -517,14 +491,6 @@ ul.projects div.root a.project
div.issue div#relations
margin-top: 25px
fieldset#columns
table
width: auto
td
border: 0
vertical-align: middle
/* all kinds of wonderful tweaks
.question pre
@ -546,26 +512,7 @@ div.issue hr
h2 + h3
margin-top: 12px
/* add filter select box on non-issue pages
fieldset#filters div.add-filter
text-align: left
margin: 0 0 6px 0
.nosidebar
#add_filter_select
margin-bottom: 6px
.box fieldset
line-height: 1.5
margin: 0 0 12px 180px
legend
margin-bottom: 6px
fieldset ul li
background: none
.nosidebar
fieldset ul
margin-left: 0
ol.ui-sortable li
list-style: none outside none
@ -582,13 +529,6 @@ tr.time-entry
#content table .changeset td.id a:hover
text-decoration: underline
/* issue updates
#update
fieldset .box
padding: 0
border: 0 none
#content table.files .opt-desc
width: 45%
@ -725,9 +665,6 @@ div.indent
margin-left: 0
select#parent_wiki_menu_item_wiki_page
margin-bottom: 10px
p input
fieldset#wiki_menu_item_setting
margin-top: 10px
p
&.item-name
padding-top: 10px

@ -26,20 +26,12 @@
// See doc/COPYRIGHT.rdoc for more details.
//++
$advanced-filters--background-color: $gray-light !default
$advanced-filters--border-color: $gray !default
.advanced-filters--container
background-color: $advanced-filters--background-color
border: 1px solid $advanced-filters--border-color
border-top-width: 3px
padding: 10px
@extend %filters--container
padding: rem-calc(10px)
max-height: 250px
overflow-y: auto
legend
@extend .hidden-for-sighted
@mixin advanced-filters--sizing()
@include grid-block()
@ -128,47 +120,10 @@ $advanced-filters--border-color: $gray !default
@include grid-content(3)
.advanced-filters--spacer
border-top: 1px solid $advanced-filters--border-color
border-top: 1px solid $filters--border-color
height: 1px
margin: 0.75rem 1rem
#content fieldset.collapsible.header_collapsible
padding-top: 0
padding-bottom: 0
border: 0
margin: 0 10px 1rem 1px
fieldset.collapsible.header_collapsible > div
padding-top: 5px
padding-bottom: 5px
fieldset.collapsible.header_collapsible > *
border-left: 1px solid #E6E6E6
border-right: 1px solid #E6E6E6
border-bottom: 1px solid #E6E6E6
width: 100%
padding-left: 6px
fieldset.collapsible.header_collapsible legend
background: #E6E6E6
cursor: pointer
width: 100%
height: 23px
line-height: 24px
fieldset.collapsible.header_collapsible legend:hover
background-color: #d8d8d8
fieldset.collapsible
border-width: 1px 0 0 0
fieldset.collapsible.borders
border-width: 1px
fieldset.collapsible.collapsed.borders
border-width: 1px 0 0 0
fieldset.collapsible legend
padding-left: 16px
cursor: pointer
fieldset#date-range p
margin: 2px 0 2px 0

@ -32,15 +32,6 @@
line-height: 1.5em
border: 1px solid #e4e4e4
fieldset
li.filter
padding-top: 6px
overflow: hidden
select
margin-right: 6px
#add_filter_select
margin-bottom: 6px
li
&.filter label
clear: left
@ -59,13 +50,6 @@
/* custom query page
#content .box fieldset
border: 1px solid #ddd
margin: 18px 10px 6px
padding: 10px
legend
font-weight: bold
#content
.content-box
@include content-box

@ -383,6 +383,8 @@
## Forms: Sections and fieldsets
### standard
```
<form class="form -bordered">
<section class="form--section">
@ -422,6 +424,73 @@
</form>
```
### with controls
```
<form class="form -bordered">
<fieldset class="form--fieldset">
<legend class="form--fieldset-legend">
Various information
</legend>
<div class="form--fieldset-control">
<span class="form--fieldset-control-container">
(<a href="#">Check all</a> | <a href="#">Uncheck all</a>)
</span>
</div>
<div class="form--field -wide-label">
<label class="form--label">Multiple choices:</label>
<div class="form--field-container -vertical">
<label class="form--label-with-check-box">
<div class="form--check-box-container">
<input type="checkbox" class="form--check-box">
</div>
Apple
</label>
<label class="form--label-with-check-box">
<div class="form--check-box-container">
<input type="checkbox" class="form--check-box">
</div>
Grapefruit
</label>
</div>
</div>
</fieldset>
</form>
```
### collapsible
```
<form class="form -bordered">
<fieldset class="form--fieldset -collapsible -collapsed">
<legend class="form--fieldset-legend">
<a href="javascript:">Less important information</a>
</legend>
<div class="form--field -required" style="display:none">
<label class="form--label">Field:</label>
<div class="form--field-container">
<div class="form--text-field-container">
<input type="text" class="form--text-field">
</div>
</div>
</div>
</fieldset>
<fieldset class="form--fieldset -collapsible">
<legend class="form--fieldset-legend">
<a href="javascript:">More important information</a>
</legend>
<div class="form--field -required">
<label class="form--label">Field:</label>
<div class="form--field-container">
<div class="form--text-field-container">
<input type="text" class="form--text-field">
</div>
</div>
</div>
</fieldset>
</form>
```
## Forms: Column layout
```
@ -762,8 +831,8 @@ The modifier classes **-middle**, **-wide**, ... can be applied to the form-[inp
# Forms: Attachment fieldsets
```
<fieldset id="attachments" class="header_collapsible collapsible">
<legend title="Show/Hide attachments" ,="" onclick="toggleFieldset(this);">
<fieldset id="attachments" class="form--fieldset -collapsible">
<legend class="form--fieldset-legend" title="Show/Hide attachments" onclick="toggleFieldset(this);">
<a href="javascript:">Files<span class="fieldset-toggle-state-label hidden-for-sighted">expanded</span></a>
</legend>
<div style="">

@ -78,33 +78,6 @@ $form--field-types: (text-field, text-area, select, check-box, radio-button, ran
// cancel out foundations overflow-y: auto
overflow: visible
fieldset
legend:after
@include icon-common
float: right
padding:
right: 5px
top: 4px
&.collapsible
> legend:after
content: "\e0d4"
&.collapsed
> legend:after
content: "\e0d2"
&.with-legend-control
legend
float: left
background-color: white
margin-top: -15px
div.legend-control
margin-top: -15px
padding-bottom: 5px
span
padding-left: 5px
background-color: white
// TODO: Customise with proper jQuery UI theme.
.ui-datepicker-month,
.ui-datepicker-year
@ -169,9 +142,9 @@ fieldset
%form--fieldset-or-section
padding: 1rem
padding: 1rem 0 0
margin-bottom: 1rem
border: 1px solid $gray
border: 0
%form--fieldset-legend-or-section-title
color: lighten($body-font-color, 10)
@ -179,6 +152,7 @@ fieldset
font-weight: bold
line-height: 1.8
text-transform: uppercase
border-bottom: 1px solid $gray
// HACK. TODO: Remove fieldset element rules in various places.
.form--fieldset,
@ -187,6 +161,38 @@ fieldset.form--fieldset
.form--fieldset-legend
@extend %form--fieldset-legend-or-section-title
width: 100%
.form--fieldset.-collapsible > &
@include without-link-styling
cursor: pointer
&:after
@include icon-common
float: right
padding:
right: 5px
top: 4px
.form--fieldset.-collapsible > &
content: "\e0d4"
.form--fieldset.-collapsible.-collapsed > &,
.form--fieldset.-collapsible.collapsed > &
content: "\e0d2"
.form--fieldset-control
float: right
margin-top: -2.8rem
text-align: right
color: lighten($body-font-color, 10)
font-size: 1rem
font-style: italic
line-height: 1.8
.form--fieldset-control-container
padding: 0 0.25rem
background-color: inherit
.form--section
@extend %form--fieldset-or-section
@ -199,11 +205,9 @@ fieldset.form--fieldset
// properties to reset h3
margin: 0
padding: 0
border: 0
.form--section > &,
#content .form--section > &
border-bottom: 1px solid $gray
margin-bottom: 1rem
.form--field

@ -29,7 +29,6 @@
a, a:link
color: $content-link-color
text-decoration: none
font-weight: $content-link-font-weight
a:hover, a:active
color: $content-link-hover-active-color

@ -1 +1,17 @@
# Preview
```
<fieldset class="preview">
<legend class="preview--legend">Preview - Description</legend>
<div class="wiki">
<h2>An article that's still being written.</h2>
</div>
</fieldset>
```
```
<fieldset class="preview">
<legend class="preview--legend">Preview - Description</legend>
<span class="preview--nothing-to-preview">Nothing to preview</span>
</fieldset>
```

@ -26,5 +26,14 @@
// See doc/COPYRIGHT.rdoc for more details.
//++
.nothing-to-preview
.preview
@extend %form--fieldset-or-section
padding: 1rem
background: image-url('draft.png')
.preview--legend
@extend %form--fieldset-legend-or-section-title
border: 0
.preview--nothing-to-preview
color: red

@ -1,5 +1,16 @@
$filters--background-color: $gray-light !default
$filters--border-color: $gray !default
%filters--container
background-color: $filters--background-color
border: 1px solid $filters--border-color
border-top-width: 3px
legend
@extend .hidden-for-sighted
.simple-filters--container
border: 1px solid $advanced-filters--border-color
@extend %filters--container
padding: 1rem
margin: 0.6em 0

@ -42,13 +42,5 @@ label.no-css
input#time_entry_comments
width: 90%
#preview fieldset
margin-top: 1em
background: image-url("draft.png")
fieldset
&#notified_events .parent
padding-left: 20px
.required
color: #bb0000

@ -0,0 +1,163 @@
//-- 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.
//++
#content table {
&.issues td.center, th.center {
text-align: center;
}
}
.contextual .new-element {
background: url("../images/add.png") no-repeat scroll 6px center transparent;
padding-left: 16px;
font-size: 11px;
}
.timelines-contextual-fieldset {
float: right;
white-space: nowrap;
margin-right: 24px;
padding-left: 10px;
}
.timelines-milestone, .timelines-phase {
border: 1px solid #000;
display: inline-block;
height: 12px;
width: 12px;
margin-bottom: -3px;
margin-right: 5px;
}
.timelines-milestone {
transform: rotate(45deg);
}
.timelines-phase {
border-radius: 4px;
}
.timelines-attributes {
th {
width: 17%;
}
td {
width: 33%;
}
}
#content {
.meta table.timelines-attributes {
th, td {
padding-top: 0.5em;
padding-bottom: 0.5em;
}
}
table.timelines-rep {
width: 100%;
}
}
table.timelines-dates {
width: 100%;
}
#content table.timelines-dates th {
text-align: left;
padding-left: 1em;
padding-right: 1em;
}
table.timelines-dates {
td {
padding: 1em;
}
tbody.timelines-current-dates td {
font-weight: bold;
height: 3em;
vertical-align: middle;
padding: 0 1em;
}
}
#content table {
&.timelines-pt {
td, th {
border: 1px solid #E6E6E6;
padding: 6px;
position: relative;
text-align: left;
vertical-align: top;
}
}
&.timelines-pet {
td, th {
border: 1px solid #E6E6E6;
padding: 6px;
position: relative;
text-align: left;
vertical-align: top;
}
}
&.timelines-pt td {
&.timelines-pt-reorder, &.timelines-pt-allows_association, &.timelines-pt-actions {
width: 12%;
text-align: center;
}
}
&.timelines-pet td {
&.timelines-pet-color, &.timelines-pet-reorder, &.timelines-pet-is_default, &.timelines-pet-in_aggregation, &.timelines-pet-is_milestone, &.timelines-pet-actions {
width: 12%;
text-align: center;
}
}
}
.timelines-pet-properties {
margin-bottom: 1em;
p {
margin-left: 1em;
line-height: 2em;
}
label {
display: inline-block;
width: 10em;
}
}
.timelines-color-properties-preview {
margin-left: -22px;
}
.timelines-pet-properties .timelines-value {
margin-left: 0.4em;
}
.contextual.timelines-for_previous_heading {
margin-top: -2.6em;
}

@ -68,8 +68,8 @@ Note: Only headings to level ***three*** are supported in the wiki toolbar at th
```
<div class="wiki">
<fieldset class="header_collapsible collapsible">
<legend title="Show/Hide table of contents" onclick="toggleFieldset(this);">
<fieldset class="form--fieldset -collapsible">
<legend class="form--fieldset-legend" title="Show/Hide table of contents" onclick="toggleFieldset(this);">
<a href="javascript:">Table of Contents</a>
</legend>
<div>

@ -62,8 +62,8 @@
@import content/tabular
@import content/watchers
@import content/work_packages
@import content/advanced_filters
@import content/simple_filters
@import content/advanced_filters
@import content/work_packages_table
@import content/attributes_key_value
@import content/attributes_group

@ -148,12 +148,6 @@
.avatar-mini
float: left
#timelog, #attachments
padding-left: 0
padding-right: 0
margin-right: 0 !important
#attributes
.form--field-container
max-width: 400px

@ -93,3 +93,8 @@
@mixin allow-vertical-scrolling
overflow-x: hidden
overflow-y: auto
@mixin without-link-styling
a:link, a:hover, a:active, a:visited
color: inherit
text-decoration: none

@ -122,7 +122,6 @@ $content-link-color: #06799F !default
$content-link-hover-active-color: #06799F !default
$content-icon-link-color: #4b4b4b !default
$content-icon-link-hover-color: #06799F !default
$content-link-font-weight: bold !default
$content-icon-color: #06799F !default

@ -102,151 +102,6 @@ module TimelinesHelper
parent
end
# TODO Refactoring
def header_tags
%{
<style type='text/css'>
#content table.issues td.center,
#content table th.center {
text-align: center;
}
.contextual .new-element {
background: url("../images/add.png") no-repeat scroll 6px center transparent;
padding-left: 16px;
font-size: 11px;
}
.timelines-contextual-fieldset {
float:right;
white-space:nowrap;
margin-right:24px;
padding-left:10px;
}
.timelines-milestone, .timelines-phase {
border: 1px solid #000;
display: inline-block;
height: 12px;
width: 12px;
margin-bottom: -3px;
margin-right: 5px;
}
.timelines-milestone {
transform: rotate(45deg);
}
.timelines-phase {
border-radius: 4px;
}
.timelines-attributes th {
width: 17%;
}
.timelines-attributes td {
width: 33%;
}
#content .meta table.timelines-attributes th,
#content .meta table.timelines-attributes td {
padding-top: 0.5em;
padding-bottom: 0.5em;
}
#content table.timelines-rep,
table.timelines-dates {
width: 100%;
}
#content table.timelines-dates th {
text-align: left;
padding-left: 1em;
padding-right: 1em;
}
table.timelines-dates td {
padding: 1em;
}
table.timelines-dates tbody.timelines-current-dates td {
font-weight: bold;
height: 3em;
vertical-align: middle;
padding: 0 1em;
}
#content table.timelines-pt td, #content table.timelines-pt th,
#content table.timelines-pet td, #content table.timelines-pet th {
border: 1px solid #E6E6E6;
padding: 6px;
position: relative;
text-align: left;
vertical-align: top;
}
#content table.timelines-pt td.timelines-pt-reorder,
#content table.timelines-pt td.timelines-pt-allows_association,
#content table.timelines-pt td.timelines-pt-actions,
#content table.timelines-pet td.timelines-pet-color,
#content table.timelines-pet td.timelines-pet-reorder,
#content table.timelines-pet td.timelines-pet-is_default,
#content table.timelines-pet td.timelines-pet-in_aggregation,
#content table.timelines-pet td.timelines-pet-is_milestone,
#content table.timelines-pet td.timelines-pet-actions {
width: 12%;
text-align: center;
}
.timelines-pet-properties,
.timelines-reporting-properties p {
margin-bottom: 1em;
}
.timelines-pet-properties p,
.timelines-reporting-properties p {
margin-left: 1em;
line-height: 2em;
}
.timelines-pet-properties label,
.timelines-pt-properties label {
display: inline-block;
width: 10em;
}
.timelines-color-properties-preview {
margin-left: -22px;
}
.timelines-reporting-properties .timelines-value,
.timelines-pet-properties .timelines-value,
.timelines-pt-properties .timelines-value {
margin-left: 0.4em;
}
.contextual.timelines-for_previous_heading {
margin-top: -2.6em;
}
</style>
<script>
jQuery(function () {
jQuery('.timelines-x-update-color').each(function(idx, element) {
var preview, input, func, target;
preview = jQuery(this);
target = preview.data('target')
if(target) {
input = jQuery(target);
} else {
input = preview.next('input');
}
if (input.length == 0) {
return;
}
func = function () {
preview.css('background-color', input.val());
};
input.keyup(func).change(func).focus(func);
func();
});
});
</script>
}.html_safe
end
def none_option
result = [[l('timelines.filter.noneSelection'), -1]]
end

@ -41,8 +41,8 @@ an attachments_attributes= and not every model supports this we build a nested f
<% open ||= false %>
<fieldset id="attachments" class="header_collapsible collapsible<%= open ? '' : ' collapsed' %>">
<legend title="<%=l(:description_attachment_toggle)%>", onclick="toggleFieldset(this);">
<fieldset id="attachments" class="form--fieldset -collapsible<%= open ? '' : ' collapsed' %>">
<legend class="form--fieldset-legend" title="<%=l(:description_attachment_toggle)%>" onclick="toggleFieldset(this);">
<a href="javascript:"><%=l(:label_attachment_plural)%></a>
</legend>
<div <%= 'style="display: none;"' unless open %>>

@ -52,7 +52,7 @@ See doc/COPYRIGHT.rdoc for more details.
<%= preview_link preview_board_topics_path(@board), 'message-form-preview', class: 'button' %>
<%= link_to l(:button_cancel), "#", onclick: 'Element.hide("add-message")', class: 'button' %>
<% end %>
<div id="preview" class="wiki"></div>
<div id="preview"></div>
<% end %>
</div>

@ -28,11 +28,14 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<% texts.each_pair do |caption, text| %>
<fieldset class="preview"><legend><%= "#{l(:label_preview)} - #{caption}" %></legend>
<fieldset class="preview">
<legend class="preview--legend"><%= "#{l(:label_preview)} - #{caption}" %></legend>
<% if text.blank? %>
<span class="nothing-to-preview"><%= l(:nothing_to_preview) %></span>
<span class="preview--nothing-to-preview"><%= l(:nothing_to_preview) %></span>
<% else %>
<%= format_text text, attachments: attachments, object: previewed %>
<div class="wiki">
<%= format_text text, attachments: attachments, object: previewed %>
</div>
<% end %>
</fieldset>
<% end %>

@ -32,7 +32,7 @@ See doc/COPYRIGHT.rdoc for more details.
<h2><%=l(:label_project_new)%></h2>
<%= labelled_tabular_form_for @copy_project, :url => { :action => "copy" } do |f| %>
<div class="copy box">
<section class="form--section">
<%= render :partial => "projects/form/attributes/name", :locals => { :form => f } %>
<%= render :partial => "projects/form/attributes/identifier", :locals => { :form => f,
:project => @copy_project } %>
@ -54,7 +54,7 @@ See doc/COPYRIGHT.rdoc for more details.
:locals => { :form => f, :project => @project, :issue_custom_fields => @issue_custom_fields } %>
<%= render :partial => "copy_projects/copy_settings/enabled_module_names",
:locals => { :project => @project } %>
</div>
</section>
<%= render :partial => "copy_projects/copy_settings/copy_associations", :locals => { :project => @project } %>

@ -27,8 +27,8 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<fieldset class="copy box">
<legend><%= l(:button_copy) %></legend>
<fieldset class="form--fieldset">
<legend class="form--fieldset-legend"><%= l(:button_copy) %></legend>
<%= render :partial => "copy_projects/copy_settings/block_checkbox",
:locals => { :name => "queries", :checked => true, :label => l(:label_query_plural),

@ -42,4 +42,4 @@ See doc/COPYRIGHT.rdoc for more details.
<%= f.submit l(:button_save), class: 'button -highlight' %>
<%= preview_link preview_topic_path(@message), 'message-form-preview', class: 'button' %>
<% end %>
<div id="preview" class="wiki"></div>
<div id="preview"></div>

@ -42,4 +42,4 @@ See doc/COPYRIGHT.rdoc for more details.
<%= preview_link preview_board_topics_path(@board), 'message-form-preview', class: 'button' %>
<% end %>
<div id="preview" class="wiki"></div>
<div id="preview"></div>

@ -123,7 +123,7 @@ See doc/COPYRIGHT.rdoc for more details.
<%= f.submit l(:button_submit), class: 'button -highlight' %>
<%= preview_link preview_topic_path(@message), 'message-form-preview', class: 'button' %>
<% end %>
<div id="preview" class="wiki"></div>
<div id="preview"></div>
</div>
<% end %>

@ -37,4 +37,4 @@ See doc/COPYRIGHT.rdoc for more details.
<%= submit_tag l(:button_save), class: 'button -highlight' %>
<%= preview_link preview_news_path(@news), 'news-form-preview', class: 'button preview' %>
<% end %>
<div id="preview" class="wiki"></div>
<div id="preview"></div>

@ -37,4 +37,4 @@ See doc/COPYRIGHT.rdoc for more details.
<%= submit_tag l(:button_create), class: 'button -highlight' %>
<%= preview_link preview_news_index_path, 'news-form-preview', class: 'button' %>
<% end %>
<div id="preview" class="wiki"></div>
<div id="preview"></div>

@ -54,7 +54,7 @@ See doc/COPYRIGHT.rdoc for more details.
class: 'button'%>
<%= preview_link preview_news_path(@news), 'news-form-preview', class: 'button' %>
<% end %>
<div id="preview" class="wiki"></div>
<div id="preview"></div>
</div>
<% end %>
<p><% unless @news.summary.blank? %><em><%=h @news.summary %></em><br />

@ -27,8 +27,6 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= header_tags %>
<%= labelled_tabular_form_for @color,
:url => color_url(@color),
:html => {:method => 'delete'},

@ -27,8 +27,6 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= header_tags %>
<% html_title l(:label_administration), "#{l(:label_edit)} #{l("timelines.admin_menu.color")} #{@color.name}" %>
<%= labelled_tabular_form_for @color,

@ -27,8 +27,6 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= header_tags %>
<% content_for :action_menu_specific do %>
<%= link_to(l("timelines.new_color"),
new_color_path,

@ -27,8 +27,6 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= header_tags %>
<% html_title l(:label_administration), "#{l(:label_new)} #{l("timelines.admin_menu.color")}" %>
<%= labelled_tabular_form_for @color,

@ -27,8 +27,6 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= header_tags %>
<%= labelled_tabular_form_for @project_association,
:url => project_project_association_path(@project, @project_association),
:html => {:method => 'delete'} do |f| %>

@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= header_tags %>
<%= labelled_tabular_form_for @project_association,
:url => project_project_association_path(@project, @project_association),

@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= header_tags %>
<% html_title(l('timelines.associations')) %>
<% content_for :action_menu_specific do %>

@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= header_tags %>
<% unless User.current.impaired? %>
<%# TODO: Require autocompleter inside select_boxes.js
For lack of a requiring policy (such as requirejs), just include the

@ -27,8 +27,6 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= header_tags %>
<%= labelled_tabular_form_for(@project_type,
:url => project_type_path(@project_type),
:html => {:method => 'delete'}) do |f| %>
@ -42,8 +40,8 @@ See doc/COPYRIGHT.rdoc for more details.
<%=h @project_type.name %>
</h2>
<fieldset class="timelines-pt-properties">
<legend><%= l('timelines.properties') %></legend>
<fieldset class="form--fieldset">
<legend class="form--fieldset-legend"><%= l('timelines.properties') %></legend>
<div class="form--field">
<%= f.check_box :allows_association, disabled: true %>
</div>

@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= header_tags %>
<% html_title l(:label_administration), "#{l(:label_edit)} #{l("timelines.admin_menu.project_type")} #{@project_type.name}" %>

@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= header_tags %>
<% content_for :action_menu_specific do %>
<%= link_to(l("timelines.new_project_type"),

@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= header_tags %>
<% html_title l(:label_administration), "#{l(:label_new)} #{l("timelines.admin_menu.project_type")}" %>

@ -31,16 +31,18 @@ See doc/COPYRIGHT.rdoc for more details.
<!--[form:project]-->
<%= render partial: "projects/form/project_attributes",
locals: { project: project,
form: f } %>
<section class="form--section">
<%= render partial: "projects/form/project_attributes",
locals: { project: project,
form: f } %>
<%= call_hook(:view_projects_form,
project: project,
form: f) %>
<%= call_hook(:view_projects_form,
project: project,
form: f) %>
</section>
<% if project.new_record? %>
<div class="form-space">
<div>
<%= render partial: "projects/form/modules",
locals: { form: f } %>
</div>
@ -49,7 +51,7 @@ See doc/COPYRIGHT.rdoc for more details.
<% end %>
<% if (project.new_record? || project.module_enabled?('work_package_tracking')) && renderTypes %>
<div class="form-space">
<div>
<%= render partial: 'projects/form/types',
locals: { f: f,
project: project } %>

@ -27,10 +27,10 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<fieldset class="box with-legend-control" id="project_issue_custom_fields">
<legend><%=l(:label_custom_field_plural)%></legend>
<div class="legend-control">
<span>
<fieldset class="form--fieldset -with-control" id="project_issue_custom_fields">
<legend class="form--fieldset-legend"><%=l(:label_custom_field_plural)%></legend>
<div class="form--fieldset-control">
<span class="form--fieldset-control-container">
(<%= check_all_links 'project_issue_custom_fields' %>)
</span>
</div>

@ -31,11 +31,11 @@ See doc/COPYRIGHT.rdoc for more details.
project = form.object
%>
<fieldset class="box with-legend-control">
<legend><%= l(:text_select_project_modules) %></legend>
<fieldset class="form--fieldset -with-control">
<legend class="form--fieldset-legend"><%= l(:text_select_project_modules) %></legend>
<div class="legend-control">
<span>
<div class="form--fieldset-control">
<span class="form--fieldset-control-container">
(<%= check_all_links 'modules-form' %>)
</span>
</div>

@ -35,10 +35,12 @@ See doc/COPYRIGHT.rdoc for more details.
id: "types_flash_notice",
class: "ignored-by-flash-activation" %>
<fieldset class="box with-legend-control" id="project_types">
<legend><%=l(:label_type_plural)%></legend>
<div class="legend-control">
<span>(<%= link_to(l(:button_check_all), "#", id: "check_all_types") + ' | ' + link_to(l(:button_uncheck_all), "#", id: "uncheck_all_types") %>)</span>
<fieldset class="form--fieldset -with-control" id="project_types">
<legend class="form--fieldset-legend"><%=l(:label_type_plural)%></legend>
<div class="form--fieldset-control">
<span class="form--fieldset-control-container">
(<%= link_to(l(:button_check_all), "#", id: "check_all_types") + ' | ' + link_to(l(:button_uncheck_all), "#", id: "uncheck_all_types") %>)
</span>
</div>
<table class='list types'>
<thead>

@ -28,7 +28,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<% extend TimelinesHelper %>
<%= header_tags %>
<%= form_for @project,
:url => { :action => 'types', :id => @project },

@ -27,8 +27,8 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<fieldset class="timelines-reporting-properties">
<legend><%= l('timelines.properties') %></legend>
<fieldset class="form--fieldset">
<legend class="form--fieldset-legend"><%= l('timelines.properties') %></legend>
<p>
<label for="reporting_reported_project_status_id">

@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= header_tags %>
<% html_title l('timelines.reporting_for_project.show',
:title => h(@reporting.reporting_to_project.name)) %>

@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= header_tags %>
<% unless User.current.impaired? %>
<%# TODO: Require autocompleter inside select_boxes.js
For lack of a requiring policy (such as requirejs), just include the
@ -50,8 +50,8 @@ See doc/COPYRIGHT.rdoc for more details.
<%= error_messages_for 'project' %>
<fieldset class="timelines-reporting-properties">
<legend><%= l('timelines.properties') %></legend>
<fieldset class="form--fieldset">
<legend class="form--fieldset-legend"><%= l('timelines.properties') %></legend>
<div class="form--field -required">
<%= f.select :reported_project_status_id,
@reporting.possible_reported_project_statuses.map { |s|

@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= header_tags %>
<%= javascript_include_tag 'contextual_fieldset.js' %>
<% content_for :action_menu_specific do %>
<%= link_to_if_authorized(l("timelines.new_reporting"),

@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= header_tags %>
<% unless User.current.impaired? %>
<%# TODO: Require autocompleter inside select_boxes.js
For lack of a requiring policy (such as requirejs), just include the
@ -45,8 +45,8 @@ See doc/COPYRIGHT.rdoc for more details.
<%= error_messages_for 'project' %>
<fieldset class="timelines-reporting-properties">
<legend><%= l('timelines.properties') %></legend>
<fieldset class="form--fieldset">
<legend class="form--fieldset-legend"><%= l('timelines.properties') %></legend>
<span class='inline-label'>
<label for="reporting_reporting_to_project_id" class="form-label -transparent">

@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= header_tags %>
<% html_title l('timelines.reporting_for_project.show',
:title => h(@reporting.reporting_to_project.name)) %>

@ -27,8 +27,8 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<fieldset id="filter_comparison" class="form--fieldset collapsible collapsed">
<legend title="<%=l(:description_filter_toggle)%>", onclick="toggleFieldset(this);">
<fieldset id="filter_comparison" class="form--fieldset -collapsible collapsed">
<legend class="form--fieldset-legend" title="<%=l(:description_filter_toggle)%>" onclick="toggleFieldset(this);">
<a href="javascript:"><%= l('timelines.filter.comparisons') %></a>
</legend>

@ -27,8 +27,8 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<fieldset id="filter_general" class="form--fieldset collapsible">
<legend title="<%=l(:description_filter_toggle)%>", onclick="toggleFieldset(this);">
<fieldset id="filter_general" class="form--fieldset -collapsible">
<legend class="form--fieldset-legend" title="<%=l(:description_filter_toggle)%>" onclick="toggleFieldset(this);">
<a href="javascript:"><%= l('timelines.filter.timeline') %></a>
</legend>

@ -27,8 +27,8 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<fieldset id="filter_comparison" class="form--fieldset collapsible collapsed">
<legend title="<%=l(:description_filter_toggle)%>", onclick="toggleFieldset(this);">
<fieldset id="filter_comparison" class="form--fieldset -collapsible collapsed">
<legend class="form--fieldset-legend" title="<%=l(:description_filter_toggle)%>" onclick="toggleFieldset(this);">
<a href="javascript:"><%= l('timelines.vertical_work_package') %></a>
</legend>

@ -29,9 +29,7 @@ See doc/COPYRIGHT.rdoc for more details.
<% html_title I18n.t("timelines.delete_timeline", :timeline => @timeline.name) %>
<%= header_tags %>
<%= form_for :timeline,
<%= labelled_tabular_form_for @timeline,
:url => project_timeline_path(@project, @timeline),
:html => {:method => 'delete'} do |f| %>
@ -43,13 +41,12 @@ See doc/COPYRIGHT.rdoc for more details.
<%=h @timeline.name %>
</h2>
<fieldset class="tabular">
<legend><%= l('timelines.properties') %></legend>
<fieldset class="form--fieldset">
<legend class="form--fieldset-legend"><%= l('timelines.properties') %></legend>
<p>
<%= f.label :name %>
<%= f.text_field :name, :disabled => true %>
</p>
<div class="form--field">
<%= f.text_field :name, disabled: true %>
</div>
</fieldset>
<%= submit_tag l(:button_delete), class: 'button -highlight' %>

@ -33,7 +33,7 @@ See doc/COPYRIGHT.rdoc for more details.
<%= labelled_tabular_form_for(@timeline,
:url => project_timeline_path(@project, @timeline),
:html => {:class => "tabular form", :method => 'put'}) do |f| %>
:html => {:method => 'put'}) do |f| %>
<%= render(:partial => "timelines/form",
:locals => {:f => f, :timeline => @timeline}) %>

@ -27,8 +27,8 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<fieldset id="planning_element_filters" class="form--fieldset collapsible collapsed">
<legend title="<%=l(:description_filter_toggle)%>", onclick="toggleFieldset(this);">
<fieldset id="planning_element_filters" class="form--fieldset -collapsible collapsed">
<legend class="form--fieldset-legend" title="<%=l(:description_filter_toggle)%>" onclick="toggleFieldset(this);">
<a href="javascript:"><%= l('timelines.filter.work_package_filters') %></a>
</legend>

@ -27,8 +27,8 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<fieldset id="project_filters" class="form--fieldset collapsible collapsed">
<legend title="<%=l(:description_filter_toggle)%>", onclick="toggleFieldset(this);">
<fieldset id="project_filters" class="form--fieldset -collapsible collapsed">
<legend class="form--fieldset-legend" title="<%=l(:description_filter_toggle)%>" onclick="toggleFieldset(this);">
<a href="javascript:"><%= l('timelines.filter.project_filters') %></a>
</legend>

@ -27,8 +27,8 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<fieldset id="grouping" class="form--fieldset collapsible collapsed">
<legend title="<%=l(:description_filter_toggle)%>", onclick="toggleFieldset(this);">
<fieldset id="grouping" class="form--fieldset -collapsible collapsed">
<legend class="form--fieldset-legend" title="<%=l(:description_filter_toggle)%>" onclick="toggleFieldset(this);">
<a href="javascript:"><%= l('timelines.filter.grouping') %></a>
</legend>

@ -33,7 +33,7 @@ See doc/COPYRIGHT.rdoc for more details.
<%= labelled_tabular_form_for(@timeline,
:url => project_timelines_path,
:html => {:class => "tabular form", :method => 'post'}) do |f| %>
:html => {:method => 'post'}) do |f| %>
<%= render(:partial => "timelines/form",
:locals => {:f => f, :timeline => @timeline}) %>

@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= header_tags %>
<% content_for :action_menu_specific do %>
<%= link_to l(:label_type_new), {:action => 'new'}, :class => 'icon icon-add' %>

@ -34,9 +34,9 @@ See doc/COPYRIGHT.rdoc for more details.
<%= form_tag status_by_version_path(version),
:id => "status_by_form" do %>
<fieldset>
<fieldset class="form--fieldset">
<legend>
<legend class="form--fieldset-legend">
<%= l(:label_work_package_plural) %>
</legend>

@ -45,7 +45,7 @@ See doc/COPYRIGHT.rdoc for more details.
<div id="version-summary">
<% if @version.estimated_hours > 0 || User.current.allowed_to?(:view_time_entries, @project) %>
<fieldset><legend><%= l(:label_time_tracking) %></legend>
<fieldset class="form--fieldset"><legend class="form--fieldset-legend"><%= l(:label_time_tracking) %></legend>
<table>
<tr>
<td width="130px" align="right"><%= Version.human_attribute_name(:estimated_hours) %></td>
@ -71,7 +71,7 @@ See doc/COPYRIGHT.rdoc for more details.
<%= render(:partial => "wiki/content", :locals => {:content => @version.wiki_page.content}) if @version.wiki_page %>
<% if @issues.present? %>
<fieldset class="related-issues"><legend><%= l(:label_related_work_packages) %></legend>
<fieldset class="form--fieldset related_issues"><legend class="form--fieldset-legend"><%= l(:label_related_work_packages) %></legend>
<ul>
<% @issues.each do |issue| -%>
<li><%= link_to_work_package(issue, :project => issue.project != @version.project) %></li>

@ -47,7 +47,7 @@ See doc/COPYRIGHT.rdoc for more details.
<%= preview_link preview_project_wiki_path(@project, @page), 'wiki_form-preview', class: 'button' %>
<%= wikitoolbar_for 'content_text' %>
<% end %>
<div id="preview" class="wiki"></div>
<div id="preview"></div>
<% content_for :header_tags do %>
<%= robot_exclusion_tag %>
<% end %>

@ -66,7 +66,7 @@ See doc/COPYRIGHT.rdoc for more details.
<%= wikitoolbar_for 'content_text' %>
<% end %>
<div id="preview" class="wiki"></div>
<div id="preview"></div>
<% content_for :header_tags do %>
<%= robot_exclusion_tag %>

@ -90,5 +90,5 @@ See doc/COPYRIGHT.rdoc for more details.
<%= link_to_work_package_preview(work_package) %>
<% end %>
<div id="preview" class="wiki">
<div id="preview">
</div>

@ -74,8 +74,8 @@ See doc/COPYRIGHT.rdoc for more details.
<% if work_package.new_record? && User.current.allowed_to?(:add_work_package_watchers, project) -%>
<% watcher_blocks = work_package.possible_watcher_users.sort.in_groups(3, false) %>
<fieldset id="timelog" class="header_collapsible collapsible">
<legend title="<%=l(:label_work_package_watchers)%>", onclick="toggleFieldset(this);">
<fieldset id="timelog" class="form--fieldset -collapsible">
<legend class="form--fieldset-legend" title="<%=l(:label_work_package_watchers)%>" onclick="toggleFieldset(this);">
<a href="javascript:"><%=l(:label_work_package_watchers)%></a>
</legend>
<div id="watchers_form" class="grid-block">

@ -31,8 +31,8 @@ See doc/COPYRIGHT.rdoc for more details.
time_entry,
{ :builder => TabularFormBuilder,
:lang => current_language} do |fields| %>
<fieldset id="timelog" class="header_collapsible collapsible">
<legend title="<%=l(:button_log_time)%>", onclick="toggleFieldset(this);">
<fieldset id="timelog" class="form--fieldset -collapsible">
<legend class="form--fieldset-legend" title="<%=l(:button_log_time)%>" onclick="toggleFieldset(this);">
<a href="javascript:"><%=l(:button_log_time)%></a>
</legend>

@ -29,8 +29,8 @@ See doc/COPYRIGHT.rdoc for more details.
<h2><%= @query.new_record? ? l(:label_calendar) : h(@query.name) %></h2>
<%= form_tag(work_packages_calendar_index_path, :method => :get, :id => 'query_form') do %>
<%= hidden_field_tag('project_id', @project.to_param) if @project%>
<fieldset id="filters" class="header_collapsible collapsible <%= @query.new_record? ? "" : "collapsed" %>">
<legend onclick="toggleFieldset(this);"><a href="javascript:"><%= l(:label_filter_plural) %></a></legend>
<fieldset id="filters" class="form--fieldset -collapsible <%= @query.new_record? ? "" : "collapsed" %>">
<legend class="form--fieldset-legend" onclick="toggleFieldset(this);"><a href="javascript:"><%= l(:label_filter_plural) %></a></legend>
<div class=""<%= " style=\"display: none;\"" if !@query.new_record? %>>
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
</div>

@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= header_tags %>
<h2><%= @copy ? l(:button_copy) : l(:button_move) %></h2>
<ul>
<% @work_packages.each do |work_package| -%>

@ -57,7 +57,7 @@ See doc/COPYRIGHT.rdoc for more details.
<%= javascript_tag "Form.Element.focus('#{f.object_name}_subject');" %>
<% end %>
<div id="preview" class="wiki"></div>
<div id="preview"></div>
<% content_for :header_tags do %>
<%= robot_exclusion_tag %>

@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= header_tags %>
<%= javascript_include_tag("work_packages.js") %>
<%= render :partial => 'work_packages/action_menu', :locals => { work_package: work_package } %>

@ -33,7 +33,7 @@ See doc/COPYRIGHT.rdoc for more details.
<fieldset class="simple-filters--container">
<legend><%=l(:text_workflow_edit)%></legend>
<ul class="simple-filters--filters">
<li class="simple-filters-filter">
<li class="simple-filters--filter">
<%= styled_label_tag :role_id, Role.model_name.human, class: 'simple-filters--filter-name' %>
<div class="simple-filters--filter-value">
<%= styled_select_tag 'role_id', options_from_collection_for_select(@roles, "id", "name", @role && @role.id) %>
@ -47,7 +47,7 @@ See doc/COPYRIGHT.rdoc for more details.
</div>
</div>
</li>
<li class="simple-filters-filter">
<li class="simple-filters--filter">
<%= styled_label_tag :type_id, Type.model_name.human, class: 'simple-filters--filter-name' %>
<div class="simple-filter--filter-value">
<%= styled_select_tag 'type_id', options_from_collection_for_select(@types, "id", "name", @type && @type.id) %>
@ -64,16 +64,16 @@ See doc/COPYRIGHT.rdoc for more details.
<%= hidden_field_tag 'role_id', @role.id %>
<%= render :partial => 'form', :locals => {:name => 'always', :workflows => @workflows['always']} %>
<fieldset class="collapsible" style="padding: 0; margin-top: 0.5em;">
<legend onclick="toggleFieldset(this);"><a href="javascript:"><%= l(:label_additional_workflow_transitions_for_author) %></a></legend>
<fieldset class="form--fieldset -collapsible" style="margin-top: 0.5em;">
<legend class="form--fieldset-legend" onclick="toggleFieldset(this);"><a href="javascript:"><%= l(:label_additional_workflow_transitions_for_author) %></a></legend>
<div id="author_workflows" style="margin: 0.5em 0 0.5em 0;">
<%= render :partial => 'form', :locals => {:name => 'author', :workflows => @workflows['author']} %>
</div>
</fieldset>
<%= javascript_tag "hideFieldset($('author_workflows'))" unless @workflows['author'].present? %>
<fieldset class="collapsible" style="padding: 0;">
<legend onclick="toggleFieldset(this);"><a href="javascript:"><%= l(:label_additional_workflow_transitions_for_assignee) %></a></legend>
<fieldset class="form--fieldset -collapsible">
<legend class="form--fieldset-legend" onclick="toggleFieldset(this);"><a href="javascript:"><%= l(:label_additional_workflow_transitions_for_assignee) %></a></legend>
<div id="assignee_workflows" style="margin: 0.5em 0 0.5em 0;">
<%= render :partial => 'form', :locals => {:name => 'assignee', :workflows => @workflows['assignee']} %>
</div>

@ -394,7 +394,8 @@ module OpenProject
div_class = 'toc'
div_class << ' right' if $1 == '>'
div_class << ' left' if $1 == '<'
out = "<fieldset class='header_collapsible collapsible'><legend title='" + l(:description_toc_toggle) + "' onclick='toggleFieldset(this);'><a href='javascript:'>#{l(:label_table_of_contents)}</a></legend><div>"
out = "<fieldset class='form--fieldset -collapsible'>"
out << "<legend class='form--fieldset-legend' title='" + l(:description_toc_toggle) + "' onclick='toggleFieldset(this);'><a href='javascript:'>#{l(:label_table_of_contents)}</a></legend><div>"
out << "<ul class=\"#{div_class}\"><li>"
root = headings.map(&:first).min
current = root

@ -31,7 +31,7 @@ require 'features/work_packages/work_packages_page'
shared_context 'Toggable fieldset examples' do
def toggable_title
find('legend a', text: fieldset_name)
find('legend a', text: /#{fieldset_name}/i)
end
def toggable_content

@ -542,6 +542,73 @@ EXPECTED
end
end
describe '{{toc}}', 'table of contents macro' do
# Source: http://en.wikipedia.org/wiki/Orange_(fruit)
let(:wiki_text) {
<<-WIKI_TEXT
{{toc}}
h1. Orange
h2. Varietes
h3. Common Oranges
h4. Valencia
h5. Naranjito
h4. Hart's Tardiff Valencia
h3. Navel Oranges
h3. Blood Oranges
h3. Acidless Oranges
h2. Attributes
WIKI_TEXT
}
subject(:html) { format_text(wiki_text) }
it 'emits a table of contents for headings h1-h4' do
expect(html).to be_html_eql(%{
<fieldset class='form--fieldset -collapsible'>
<legend class='form--fieldset-legend' title='Show/Hide table of contents' onclick='toggleFieldset(this);'>
<a href='javascript:'>Table of Contents</a>
</legend>
<div>
<ul class="toc">
<li>
<a href="#Orange">Orange</a>
<ul>
<li>
<a href="#Varietes">Varietes</a>
<ul>
<li>
<a href="#Common-Oranges">Common Oranges</a>
<ul>
<li><a href="#Valencia">Valencia</a></li>
<li><a href="#Harts-Tardiff-Valencia">Hart's Tardiff Valencia</a></li>
</ul>
</li>
<li><a href="#Navel-Oranges">Navel Oranges</a></li>
<li><a href="#Blood-Oranges">Blood Oranges</a></li>
<li><a href="#Acidless-Oranges">Acidless Oranges</a></li>
</ul>
</li>
<li><a href="#Attributes">Attributes</a></li>
</ul>
</li>
</ul>
</div>
</fieldset>
}).at_path('fieldset')
end
end
context 'deprecated methods' do
subject { self }

Loading…
Cancel
Save