events:
'click .js-issues-toggle-filters': 'toggleFilters'
'click .js-issues-filter': 'applyFilter'
- 'click .js-issues-new-search': 'newSearch'
- 'click .js-issues-save-as': 'saveAs'
- 'click .js-issues-save': 'save'
- 'click .js-issues-copy': 'copy'
- 'click .js-issues-edit': 'edit'
+ 'click #issues-new-search': 'newSearch'
+ 'click #issues-filter-save-as': 'saveAs'
+ 'click #issues-filter-save': 'save'
+ 'click #issues-filter-copy': 'copy'
+ 'click #issues-filter-edit': 'edit'
initialize: (options) ->
filter.fetch().done => @options.app.controller.applyFilter filter
+ onRender: ->
+ @$el.toggleClass 'issues-filters-selected', @options.app.state.has('filter')
+
+
toggleFilters: ->
@$('.issues-filters-list').toggle()
_.extend super,
state: @options.app.state.toJSON()
filter: @options.app.state.get('filter')?.toJSON()
+ currentUser: window.SS.user
--- /dev/null
+{{#if filter.name}}
+ {{filter.name}}
+ <span class="subtitle nowrap">
+ {{#unless filter.shared}}
+ [{{t 'issue_filter.private'}}]
+ {{else}}
+ {{#eq filter.user currentUser}}
+ [{{t 'issue_filter.shared_with_all_users'}}]
+ {{else}}
+ {{#if filter.user}}
+ [{{t 'issue_filter.shared'}}]
+ {{/if}}
+ {{/eq}}
+ {{/unless}}
+ </span>
+{{else}}
+ {{t 'issues'}}
+{{/if}}
</div>
<div class="issues-filters-header">
- {{#notEmpty items}}
- <a class="issues-filters-button issues-filters-header-filters js-issues-toggle-filters">
- {{default filter.name "Saved Filters"}}
+ {{#if state.canManageFilters}}
+ <a class="issues-filters-show-list js-issues-toggle-filters">
+ <i class="icon-list"></i> <span class="issues-filters-name">{{> '_issues-filter-name'}}</span>
</a>
- {{/notEmpty}}
+ {{#if filter.description}}
+ <div class="issues-filters-description">{{filter.description}}</div>
+ {{/if}}
+ {{else}}
+ <span class="issues-filters-name">{{t 'issues'}}</span>
+ {{/if}}
+</div>
- <span class="issues-filters-header-actions">
- <a class="issues-filters-button js-issues-new-search">New Search</a>
+<div class="issues-filters-actions">
+ <div class="button-group">
+ <button id="issues-new-search">{{t 'issue_filter.new_search'}}</button>
{{#if state.canManageFilters}}
{{#if filter.canModify}}
- {{#if state.changed}}
- <a class="issues-filters-button js-issues-save">{{t 'save'}}</a>
- {{/if}}
+ {{#if state.changed}}<button id="issues-filter-save">{{t 'save'}}</button>{{/if}}
{{/if}}
-
- {{#unless filter.id}}<a class="issues-filters-button js-issues-save-as">{{t 'save_as'}}</a>{{/unless}}
-
- {{#if filter.id}}<a class="issues-filters-button js-issues-copy">{{t 'copy'}}</a>{{/if}}
-
+ {{#unless filter.id}}<button id="issues-filter-save-as">{{t 'save_as'}}</button>{{/unless}}
+ {{#if filter.id}}<button id="issues-filter-copy">{{t 'copy'}}</button>{{/if}}
{{#if filter.canModify}}
- {{#if filter.id}}<a class="issues-filters-button js-issues-edit">{{t 'edit'}}</a>{{/if}}
+ {{#if filter.id}}<button id="issues-filter-edit">{{t 'edit'}}</button>{{/if}}
{{/if}}
{{/if}}
- </span>
+ </div>
</div>
width: @sideWidth;
top: 30px; left: 0; bottom: 0;
.box-sizing(border-box);
- border-right: 1px solid @barBorderColor;
background-color: @barBorderColor;
- color: #fff;
overflow-x: hidden;
}
.issues-filters {
.clearfix;
- padding: 8px 10px;
+ padding: 5px 10px;
background-color: @barBackgroundColor;
- color: @secondFontColor;
- font-size: @smallFontSize;
- font-weight: 300;
+}
+
+.issues-filters-selected {
+ margin-bottom: 5px;
+
+ .issues-filters-header {
+ float: none;
+ }
+
+ .issues-filters-actions {
+ float: none;
+ margin-top: 5px;
+ }
}
.issues-filters-list {
}
.issues-filters-header {
- font-size: @smallFontSize;
- font-weight: 300;
-}
-
-.issues-filters-header-filters {
- display: inline-block;
- max-width: 50%;
- .text-ellipsis;
+ float: left;
+ line-height: 22px;
}
-.issues-filters-header-actions {
- float: right;
+.issues-filters-name {
+ vertical-align: top;
+ font-size: @bigFontSize;
}
-.issues-filters-button {
- border-bottom-color: @secondFontColor;
- color: @secondFontColor;
+.issues-filters-description {
+ margin: 4px 0;
font-size: @smallFontSize;
- font-weight: 300;
- .trans(color);
+ font-style: italic;
+}
- &:hover, &:active {
- color: #fff;
- }
+.issues-filters-show-list {
+ margin-right: 4px;
+ border-bottom: none;
+ color: @baseFontColor;
+ font-size: @iconSmallFontSize;
+}
- &:focus {}
+.issues-filters-actions {
+ float: right;
}
.issues-workspace {
.clearfix;
margin-bottom: 10px;
padding: 5px 0;
- border: 1px solid @barBorderColor;
- border-left: none;
- background: @barBackgroundColor;
+ line-height: 22px;
+ background-color: @barBackgroundColor;
font-size: @smallFontSize;
}
<%# The two lines below mean that before full removal of Rails, we have to find a way to handle config properties %>
window.SS = typeof window.SS === 'object' ? window.SS : {};
window.SS.hoursInDay = <%= configuration('sonar.technicalDebt.hoursInDay', 8) %>;
+ window.SS.user = '<%= current_user.login if current_user -%>';
</script>
<script src="<%= ApplicationController.root_context -%>/js/sonar.js"></script>
<script>