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
Hide 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
this
.
$inject
=
[
'$controller'
,
'$document'
,
'$location'
,
'$route'
,
'$scope'
,
'$window'
,
'auth'
,
'drafts'
,
'features'
,
'identity'
,
'streamer'
,
'annotationUI'
,
's
ession'
,
's
treamer'
,
'annotationUI'
,
'annotationMapper'
,
'threading'
]
constructor
:
(
$controller
,
$document
,
$location
,
$route
,
$scope
,
$window
,
auth
,
drafts
,
features
,
identity
,
streamer
,
annotationUI
,
s
ession
,
s
treamer
,
annotationUI
,
annotationMapper
,
threading
)
->
$controller
(
'AnnotationUIController'
,
{
$scope
})
...
...
@@ -21,6 +21,9 @@ module.exports = class AppController
# if ($scope.feature('foo')) { ... }
$scope
.
feature
=
features
.
flagEnabled
# Allow all child scopes access to the session
$scope
.
session
=
session
$scope
.
auth
=
auth
isFirstRun
=
$location
.
search
().
hasOwnProperty
(
'firstrun'
)
...
...
h/static/scripts/app.coffee
View file @
41d2d3b2
...
...
@@ -102,6 +102,7 @@ module.exports = angular.module('h', [
.
directive
(
'deepCount'
,
require
(
'./directive/deep-count'
))
.
directive
(
'formInput'
,
require
(
'./directive/form-input'
))
.
directive
(
'formValidate'
,
require
(
'./directive/form-validate'
))
.
directive
(
'groupList'
,
require
(
'./directive/group-list'
))
.
directive
(
'markdown'
,
require
(
'./directive/markdown'
))
.
directive
(
'privacy'
,
require
(
'./directive/privacy'
))
.
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', ->
fakeIdentity
=
null
fakeLocation
=
null
fakeParams
=
null
fakeSession
=
null
fakeStore
=
null
fakeStreamer
=
null
fakeStreamFilter
=
null
...
...
@@ -67,6 +68,8 @@ describe 'AppController', ->
fakeParams
=
{
id
:
'test'
}
fakeSession
=
{}
fakeStore
=
{
SearchResource
:
{
get
:
sinon
.
spy
()
...
...
@@ -99,6 +102,7 @@ describe 'AppController', ->
$provide
.
value
'identity'
,
fakeIdentity
$provide
.
value
'$location'
,
fakeLocation
$provide
.
value
'$routeParams'
,
fakeParams
$provide
.
value
'session'
,
fakeSession
$provide
.
value
'store'
,
fakeStore
$provide
.
value
'streamer'
,
fakeStreamer
$provide
.
value
'streamfilter'
,
fakeStreamFilter
...
...
h/static/styles/app.scss
View file @
41d2d3b2
...
...
@@ -129,6 +129,9 @@ ol {
}
}
.group-list
{
margin-right
:
0
.5em
;
}
.user-picker
{
.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