Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
41d2d3b2
Commit
41d2d3b2
authored
Jul 31, 2015
by
Randall Leeds
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2402 from hypothesis/new-group
Enable users to create groups
parents
0dede511
86c58c80
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
2 deletions
+42
-2
app-controller.coffee
h/static/scripts/app-controller.coffee
+5
-2
app.coffee
h/static/scripts/app.coffee
+1
-0
group-list.js
h/static/scripts/directive/group-list.js
+17
-0
app-controller-test.coffee
h/static/scripts/test/app-controller-test.coffee
+4
-0
app.scss
h/static/styles/app.scss
+3
-0
group_list.html
h/templates/client/group_list.html
+12
-0
No files found.
h/static/scripts/app-controller.coffee
View file @
41d2d3b2
...
@@ -5,13 +5,13 @@ module.exports = class AppController
...
@@ -5,13 +5,13 @@ module.exports = class AppController
this
.
$inject
=
[
this
.
$inject
=
[
'$controller'
,
'$document'
,
'$location'
,
'$route'
,
'$scope'
,
'$window'
,
'$controller'
,
'$document'
,
'$location'
,
'$route'
,
'$scope'
,
'$window'
,
'auth'
,
'drafts'
,
'features'
,
'identity'
,
'auth'
,
'drafts'
,
'features'
,
'identity'
,
'streamer'
,
'annotationUI'
,
's
ession'
,
's
treamer'
,
'annotationUI'
,
'annotationMapper'
,
'threading'
'annotationMapper'
,
'threading'
]
]
constructor
:
(
constructor
:
(
$controller
,
$document
,
$location
,
$route
,
$scope
,
$window
,
$controller
,
$document
,
$location
,
$route
,
$scope
,
$window
,
auth
,
drafts
,
features
,
identity
,
auth
,
drafts
,
features
,
identity
,
streamer
,
annotationUI
,
s
ession
,
s
treamer
,
annotationUI
,
annotationMapper
,
threading
annotationMapper
,
threading
)
->
)
->
$controller
(
'AnnotationUIController'
,
{
$scope
})
$controller
(
'AnnotationUIController'
,
{
$scope
})
...
@@ -21,6 +21,9 @@ module.exports = class AppController
...
@@ -21,6 +21,9 @@ module.exports = class AppController
# if ($scope.feature('foo')) { ... }
# if ($scope.feature('foo')) { ... }
$scope
.
feature
=
features
.
flagEnabled
$scope
.
feature
=
features
.
flagEnabled
# Allow all child scopes access to the session
$scope
.
session
=
session
$scope
.
auth
=
auth
$scope
.
auth
=
auth
isFirstRun
=
$location
.
search
().
hasOwnProperty
(
'firstrun'
)
isFirstRun
=
$location
.
search
().
hasOwnProperty
(
'firstrun'
)
...
...
h/static/scripts/app.coffee
View file @
41d2d3b2
...
@@ -102,6 +102,7 @@ module.exports = angular.module('h', [
...
@@ -102,6 +102,7 @@ module.exports = angular.module('h', [
.
directive
(
'deepCount'
,
require
(
'./directive/deep-count'
))
.
directive
(
'deepCount'
,
require
(
'./directive/deep-count'
))
.
directive
(
'formInput'
,
require
(
'./directive/form-input'
))
.
directive
(
'formInput'
,
require
(
'./directive/form-input'
))
.
directive
(
'formValidate'
,
require
(
'./directive/form-validate'
))
.
directive
(
'formValidate'
,
require
(
'./directive/form-validate'
))
.
directive
(
'groupList'
,
require
(
'./directive/group-list'
))
.
directive
(
'markdown'
,
require
(
'./directive/markdown'
))
.
directive
(
'markdown'
,
require
(
'./directive/markdown'
))
.
directive
(
'privacy'
,
require
(
'./directive/privacy'
))
.
directive
(
'privacy'
,
require
(
'./directive/privacy'
))
.
directive
(
'simpleSearch'
,
require
(
'./directive/simple-search'
))
.
directive
(
'simpleSearch'
,
require
(
'./directive/simple-search'
))
...
...
h/static/scripts/directive/group-list.js
0 → 100644
View file @
41d2d3b2
'use strict'
;
/**
* @ngdoc directive
* @name groupList
* @restrict AE
* @description Displays a list of groups of which the user is a member.
*/
module
.
exports
=
function
()
{
return
{
restrict
:
'AE'
,
scope
:
{
groups
:
'='
},
templateUrl
:
'group_list.html'
};
};
h/static/scripts/test/app-controller-test.coffee
View file @
41d2d3b2
...
@@ -11,6 +11,7 @@ describe 'AppController', ->
...
@@ -11,6 +11,7 @@ describe 'AppController', ->
fakeIdentity
=
null
fakeIdentity
=
null
fakeLocation
=
null
fakeLocation
=
null
fakeParams
=
null
fakeParams
=
null
fakeSession
=
null
fakeStore
=
null
fakeStore
=
null
fakeStreamer
=
null
fakeStreamer
=
null
fakeStreamFilter
=
null
fakeStreamFilter
=
null
...
@@ -67,6 +68,8 @@ describe 'AppController', ->
...
@@ -67,6 +68,8 @@ describe 'AppController', ->
fakeParams
=
{
id
:
'test'
}
fakeParams
=
{
id
:
'test'
}
fakeSession
=
{}
fakeStore
=
{
fakeStore
=
{
SearchResource
:
{
SearchResource
:
{
get
:
sinon
.
spy
()
get
:
sinon
.
spy
()
...
@@ -99,6 +102,7 @@ describe 'AppController', ->
...
@@ -99,6 +102,7 @@ describe 'AppController', ->
$provide
.
value
'identity'
,
fakeIdentity
$provide
.
value
'identity'
,
fakeIdentity
$provide
.
value
'$location'
,
fakeLocation
$provide
.
value
'$location'
,
fakeLocation
$provide
.
value
'$routeParams'
,
fakeParams
$provide
.
value
'$routeParams'
,
fakeParams
$provide
.
value
'session'
,
fakeSession
$provide
.
value
'store'
,
fakeStore
$provide
.
value
'store'
,
fakeStore
$provide
.
value
'streamer'
,
fakeStreamer
$provide
.
value
'streamer'
,
fakeStreamer
$provide
.
value
'streamfilter'
,
fakeStreamFilter
$provide
.
value
'streamfilter'
,
fakeStreamFilter
...
...
h/static/styles/app.scss
View file @
41d2d3b2
...
@@ -129,6 +129,9 @@ ol {
...
@@ -129,6 +129,9 @@ ol {
}
}
}
}
.group-list
{
margin-right
:
0
.5em
;
}
.user-picker
{
.user-picker
{
.avatar
{
.avatar
{
...
...
h/templates/client/group_list.html
0 → 100644
View file @
41d2d3b2
<span
role=
"button"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
Groups
<i
class=
"h-icon-arrow-drop-down"
></i>
</span>
<ul
class=
"dropdown-menu pull-right"
role=
"menu"
>
<li
ng-repeat=
"group in groups"
>
<a
ng-href=
"{{group.url}}"
ng-bind=
"group.name"
target=
"_blank"
></a>
</li>
<li>
<a
href=
"/groups/new"
target=
"_blank"
><i
class=
"h-icon-add"
></i>
Create a group
</a>
</li>
</ul>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment