fixed styling
This commit is contained in:
parent
65ef905455
commit
d0930f42cf
7 changed files with 160 additions and 45 deletions
|
@ -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;
|
||||
|
|
|
@ -14,10 +14,9 @@
|
|||
</div>
|
||||
|
||||
<div class="menu">
|
||||
<a href="settings.html" class="icon icon-settings"></a>
|
||||
<a ng-href="/{{ repo.full_name }}/edit" class="nav-item settings float-right"></a>
|
||||
<button ng-click="watch(repo)" ng-if="!repo.starred" class="nav-item star float-right"></button>
|
||||
<button ng-click="unwatch(repo)" ng-if="repo.starred" class="nav-item unstar float-right"></button>
|
||||
<a ng-href="/{{ repo.full_name }}/edit" class="nav-item settings float-right" ng-if="repo.permissions.pull"></a>
|
||||
<button ng-click="watch(repo)" ng-if="!repo.starred && user" class="nav-item star float-right"></button>
|
||||
<button ng-click="unwatch(repo)" ng-if="repo.starred && user" class="nav-item unstar float-right"></button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -36,4 +35,4 @@
|
|||
</div>
|
||||
</a>
|
||||
</section>
|
||||
</article>
|
||||
</article>
|
||||
|
|
|
@ -10,16 +10,16 @@
|
|||
<div class="breadcrumb" style="position:relative;top:0px;">
|
||||
<a href="#">Dashboard</a>
|
||||
</div>
|
||||
|
||||
<div class="menu">
|
||||
<a ng-href="/new" class="nav-item add float-right"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<article>
|
||||
|
||||
|
||||
<section>
|
||||
<div class="search clearfix">
|
||||
<a href="/new">Add Repo</a>
|
||||
</div>
|
||||
|
||||
<a class="row build-row" ng-repeat="repo in repos | orderBy:'full_name'" ng-href="/{{ repo.full_name }}">
|
||||
<div>
|
||||
<div class="build-num build-last success"> </div>
|
||||
|
@ -31,4 +31,4 @@
|
|||
</a>
|
||||
|
||||
</section>
|
||||
</article>
|
||||
</article>
|
||||
|
|
|
@ -14,15 +14,22 @@
|
|||
</div>
|
||||
|
||||
<article>
|
||||
<section>
|
||||
<section style="background:transparent !important;">
|
||||
<p style="color:#9E9E9E;font-size:15px;line-height:22px;">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.</p>
|
||||
</section>
|
||||
<div class="alert alert-error" ng-if="error !== undefined">
|
||||
There was an error adding your repository. Please ensure the
|
||||
repository exists and you have admin privileges.
|
||||
</div>
|
||||
<section>
|
||||
<div style="padding:30px;">
|
||||
<input type="text" placeholder="octocat/Hello-World" ng-model="slug" style="font-size:14px;padding:10px 20px;width:400px;border: 1px solid #d9d9d9;outline:none;" />
|
||||
<div style="margin-top:20px;">
|
||||
<a href="/" style="font-size:14px; padding:10px 20px;text-transform:uppercase;background:#EEE;text-decoration:none;color:#616161;">Cancel</a>
|
||||
<button ng-click="add(slug)" style="background:#EEE;font-size:14px; padding:10px 20px;text-transform:uppercase;cursor:pointer;color:#616161;">Add</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<form>
|
||||
<input type="text" placeholder="octocat/Hello-World" ng-model="slug" />
|
||||
<button ng-click="add(slug)">Add</button>
|
||||
</form>
|
||||
</section>
|
||||
</article>
|
||||
</article>
|
||||
|
|
|
@ -25,25 +25,43 @@
|
|||
|
||||
<article>
|
||||
<section>
|
||||
<h2>Hooks</h2>
|
||||
<div class="row">
|
||||
<div>Post Commit Hooks</div>
|
||||
<div>
|
||||
<input id="post_commits" type="checkbox" hidden="hidden" ng-model="repo.post_commits" />
|
||||
<label for="post_commits" class="switch"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div>Pull Request Hooks</div>
|
||||
<div>
|
||||
<input id="pull_requests" type="checkbox" hidden="hidden" ng-model="repo.pull_requests" />
|
||||
<label for="pull_requests" class="switch"></label>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<form>
|
||||
<section ng-if="user.admin">
|
||||
<h2>Advanced</h2>
|
||||
<div class="row">
|
||||
<div>Trusted (Evelvate Privilege)</div>
|
||||
<div>
|
||||
<label>Enable Pushes</label>
|
||||
<input type="checkbox" ng-model="repo.post_commits" />
|
||||
<input id="trusted" type="checkbox" hidden="hidden" ng-model="repo.trusted" />
|
||||
<label for="trusted" class="switch"></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div>Timeout in minutes</div>
|
||||
<div>
|
||||
<label>Enable Pull Requests</label>
|
||||
<input type="checkbox" ng-model="repo.pull_requests" />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>Trusted</label>
|
||||
<input type="checkbox" ng-model="repo.trusted" />
|
||||
</div>
|
||||
<div>
|
||||
<label>Timeout</label>
|
||||
<input type="number" ng-model="repo.timeout" />
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<form>
|
||||
|
||||
<ul>
|
||||
<li ng-repeat="(key, value) in repo.params">
|
||||
<label>{{ key }}</label>
|
||||
|
@ -57,7 +75,7 @@
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<button ng-click="save(repo)">Save</button>
|
||||
<button ng-click="delete(repo.full_name)">Delete</button>
|
||||
|
@ -65,10 +83,26 @@
|
|||
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Badges</h2>
|
||||
<div class="row">
|
||||
<div>Build Status</div>
|
||||
<div>
|
||||
{{ window.location.origin }}/api/badges/{{ repo.full_name }}/status.svg</pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div>CCMenu</div>
|
||||
<div>
|
||||
{{ window.location.origin }}/api/badges/{{ repo.full_name }}/cc.xml</pre>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Public Key</h2>
|
||||
<div>
|
||||
<pre class="key">{{ repo.keypair.public }}</pre>
|
||||
</div>
|
||||
</section>
|
||||
</article>
|
||||
</article>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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"`
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue