]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7894 Document the "Anyone" group on the "Groups" page (#1108)
authorStas Vilchik <vilchiks@gmail.com>
Mon, 18 Jul 2016 15:38:55 +0000 (17:38 +0200)
committerGitHub <noreply@github.com>
Mon, 18 Jul 2016 15:38:55 +0000 (17:38 +0200)
server/sonar-web/src/main/js/apps/groups/list-view.js
server/sonar-web/src/main/js/apps/groups/templates/groups-list.hbs [new file with mode: 0644]

index 20280b7c7c4be3129b3d5d02fedb9c0cb285fae9..cca2de036ae29afa70dbbf38115e7994e5c02693 100644 (file)
  */
 import Marionette from 'backbone.marionette';
 import ListItemView from './list-item-view';
+import Template from './templates/groups-list.hbs';
 
-export default Marionette.CollectionView.extend({
-  tagName: 'ul',
+export default Marionette.CompositeView.extend({
   childView: ListItemView,
+  childViewContainer: '.js-list',
+  template: Template,
 
   collectionEvents: {
     'request': 'showLoading',
@@ -35,6 +37,10 @@ export default Marionette.CollectionView.extend({
 
   hideLoading () {
     this.$el.removeClass('new-loading');
+
+    const query = this.collection.q || '';
+    const shouldHideAnyone = !'anyone'.includes(query.toLowerCase());
+    this.$('.js-anyone').toggleClass('hidden', shouldHideAnyone);
   }
 });
 
diff --git a/server/sonar-web/src/main/js/apps/groups/templates/groups-list.hbs b/server/sonar-web/src/main/js/apps/groups/templates/groups-list.hbs
new file mode 100644 (file)
index 0000000..7182003
--- /dev/null
@@ -0,0 +1,18 @@
+<div>
+  <div class="panel panel-vertical js-anyone">
+    <div class="display-inline-block text-top width-20">
+      <strong class="js-group-name">Anyone</strong>
+    </div>
+
+    <div class="display-inline-block text-top big-spacer-left width-25">
+
+    </div>
+
+    <div class="display-inline-block text-top big-spacer-left width-40">
+      <span class="js-group-description">{{t 'user_groups.anyone.description'}}</span>
+    </div>
+
+  </div>
+
+  <ul class="js-list"></ul>
+</div>