diff --git a/cmd/drone-server/static/scripts/controllers/repos.js b/cmd/drone-server/static/scripts/controllers/repos.js index f776c14de..52106f2d3 100644 --- a/cmd/drone-server/static/scripts/controllers/repos.js +++ b/cmd/drone-server/static/scripts/controllers/repos.js @@ -25,6 +25,12 @@ * repository. */ function RepoAddCtrl($scope, $location, repos, users) { + + // Gets the currently authenticated user + users.getCached().then(function(payload){ + $scope.user = payload.data; + }); + $scope.add = function(slug) { repos.post(slug).then(function(payload) { $location.path('/'+slug); @@ -37,11 +43,14 @@ /** * RepoEditCtrl responsible for editing a repository. */ - function RepoEditCtrl($scope, $location, $routeParams, repos, users) { + function RepoEditCtrl($scope, $window, $location, $routeParams, repos, users) { var owner = $routeParams.owner; var name = $routeParams.name; var fullName = owner+'/'+name; + // Inject window for composing url + $scope.window = $window; + // Gets the currently authenticated user users.getCached().then(function(payload){ $scope.user = payload.data; diff --git a/cmd/drone-server/static/scripts/views/builds.html b/cmd/drone-server/static/scripts/views/builds.html index c9f3a9a0c..b41f8244c 100644 --- a/cmd/drone-server/static/scripts/views/builds.html +++ b/cmd/drone-server/static/scripts/views/builds.html @@ -14,10 +14,9 @@ @@ -36,4 +35,4 @@ - \ No newline at end of file + diff --git a/cmd/drone-server/static/scripts/views/repos.html b/cmd/drone-server/static/scripts/views/repos.html index e88f7de51..2784f7869 100644 --- a/cmd/drone-server/static/scripts/views/repos.html +++ b/cmd/drone-server/static/scripts/views/repos.html @@ -10,16 +10,16 @@ + +
- -
 
@@ -31,4 +31,4 @@
-
\ No newline at end of file + diff --git a/cmd/drone-server/static/scripts/views/repos_add.html b/cmd/drone-server/static/scripts/views/repos_add.html index 7d825866e..6aacf0017 100644 --- a/cmd/drone-server/static/scripts/views/repos_add.html +++ b/cmd/drone-server/static/scripts/views/repos_add.html @@ -14,15 +14,22 @@
-
+
+

Register your repository with Drone to enable automated testing. Note that Drone + will attempt to add a post-commit hook to your repository. This may require administrative access.

+
There was an error adding your repository. Please ensure the repository exists and you have admin privileges.
+
+
+ +
+ Cancel + +
+
+
-
- - -
-
-
\ No newline at end of file + diff --git a/cmd/drone-server/static/scripts/views/repos_edit.html b/cmd/drone-server/static/scripts/views/repos_edit.html index ca1277353..6512ae076 100644 --- a/cmd/drone-server/static/scripts/views/repos_edit.html +++ b/cmd/drone-server/static/scripts/views/repos_edit.html @@ -25,25 +25,43 @@
+

Hooks

+
+
Post Commit Hooks
+
+ + +
+
+
+
Pull Request Hooks
+
+ + +
+
+
-
+
+

Advanced

+
+
Trusted (Evelvate Privilege)
- - + +
+
+
+
Timeout in minutes
- - -
- -
- - -
-
-
+
+
+ +
+ +
  • @@ -57,7 +75,7 @@
- + @@ -65,10 +83,26 @@
+
+

Badges

+
+
Build Status
+
+ {{ window.location.origin }}/api/badges/{{ repo.full_name }}/status.svg +
+
+
+
CCMenu
+
+ {{ window.location.origin }}/api/badges/{{ repo.full_name }}/cc.xml +
+
+
+

Public Key

{{ repo.keypair.public }}
-
\ No newline at end of file + diff --git a/cmd/drone-server/static/styles/drone.css b/cmd/drone-server/static/styles/drone.css index 6be33f547..1cf69031c 100644 --- a/cmd/drone-server/static/styles/drone.css +++ b/cmd/drone-server/static/styles/drone.css @@ -813,6 +813,12 @@ content: "\f2e5"; } + .nav-item.add:after { + font-size: 22px; + content: "\f0fd"; + + } + input.nav-item { position: relative; height: 59px; @@ -1368,16 +1374,16 @@ section .row:last-child > div { section .build-row .build-num { display: inline-block; - width: 60px; - height:50px; - line-height:50px; - border-radius: 2px; + width: 40px; + height:40px; + line-height:40px; + border-radius: 50%; color: rgba(255,255,255,0.9); font-size: 16px; text-align: center; } section .build-row > div:last-child { - padding-left:5px; + padding-left:0px; } .pending, @@ -1403,8 +1409,8 @@ section .build-row > div:last-child { } section .build-row > div:first-child { - width:90px; - min-width: 90px; + width:70px; + min-width: 70px; } section .build-row h3 { @@ -1446,9 +1452,9 @@ pre.key { white-space: pre-wrap; word-wrap: break-word; padding:30px; - font-size:14px; + font-size:13px; line-height:18px; - color:#424242; + color:#9E9E9E; font-family: "Droid Sans Mono","Roboto","Arial"; } @@ -1456,6 +1462,23 @@ textarea:focus, input:focus{ outline: 0; } +.alert { + padding: 20px; + text-align: center; + margin-top:20px; + margin-bottom:20px; +} + +.alert-success { + background: #DCEDC8; + color: #33691E; +} + +.alert-error { + background: #F44336; + color: #FFCDD2; +} + .clearfix:after { visibility: hidden; display: block; @@ -1477,3 +1500,46 @@ textarea:focus, input:focus{ } } + + + + + +.switch { + display: inline-block; + position: relative; + width: 50px; + height: 20.833333333333336px; + border-radius: 10.416666666666668px; + background: #bdbdbd; + -webkit-transition: background 0.28s cubic-bezier(0.4, 0, 0.2, 1); + transition: background 0.28s cubic-bezier(0.4, 0, 0.2, 1); + vertical-align: middle; + cursor: pointer; +} +.switch::before { + content: ''; + position: absolute; + top: -2.604166666666667px; + left: -2.604166666666667px; + width: 26.04166666666667px; + height: 26.04166666666667px; + background: #fafafa; + box-shadow: 0 2px 10.416666666666668px rgba(0,0,0,0.28); + border-radius: 50%; + -webkit-transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1), background 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1); + transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1), background 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1); +} +.switch:active::before { + box-shadow: 0 2px 10.416666666666668px rgba(0,0,0,0.28), 0 0 0 25px rgba(0,0,0,0.1); +} +input:checked + .switch { + background: rgba(0,150,136,0.5); +} +input:checked + .switch::before { + left: 26.562499999999996px; + background: #009688; +} +input:checked + .switch:active::before { + box-shadow: 0 2px 10.416666666666668px rgba(0,0,0,0.28), 0 0 0 25px rgba(0,150,136,0.2); +} diff --git a/pkg/types/repo.go b/pkg/types/repo.go index 36db5a4ee..a8d9b683f 100644 --- a/pkg/types/repo.go +++ b/pkg/types/repo.go @@ -49,7 +49,7 @@ type RepoCommit struct { } type Perm struct { - Pull bool - Push bool - Admin bool + Pull bool `json:"pull"` + Push bool `json:"push"` + Admin bool `json:"admin"` }