fixed styling

This commit is contained in:
Brad Rydzewski 2015-05-21 17:00:31 -07:00
parent 65ef905455
commit d0930f42cf
7 changed files with 160 additions and 45 deletions

View file

@ -25,6 +25,12 @@
* repository. * repository.
*/ */
function RepoAddCtrl($scope, $location, repos, users) { function RepoAddCtrl($scope, $location, repos, users) {
// Gets the currently authenticated user
users.getCached().then(function(payload){
$scope.user = payload.data;
});
$scope.add = function(slug) { $scope.add = function(slug) {
repos.post(slug).then(function(payload) { repos.post(slug).then(function(payload) {
$location.path('/'+slug); $location.path('/'+slug);
@ -37,11 +43,14 @@
/** /**
* RepoEditCtrl responsible for editing a repository. * 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 owner = $routeParams.owner;
var name = $routeParams.name; var name = $routeParams.name;
var fullName = owner+'/'+name; var fullName = owner+'/'+name;
// Inject window for composing url
$scope.window = $window;
// Gets the currently authenticated user // Gets the currently authenticated user
users.getCached().then(function(payload){ users.getCached().then(function(payload){
$scope.user = payload.data; $scope.user = payload.data;

View file

@ -14,10 +14,9 @@
</div> </div>
<div class="menu"> <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" ng-if="repo.permissions.pull"></a>
<a ng-href="/{{ repo.full_name }}/edit" class="nav-item settings float-right"></a> <button ng-click="watch(repo)" ng-if="!repo.starred && user" class="nav-item star float-right"></button>
<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 && user" class="nav-item unstar float-right"></button>
<button ng-click="unwatch(repo)" ng-if="repo.starred" class="nav-item unstar float-right"></button>
</div> </div>
</div> </div>

View file

@ -10,16 +10,16 @@
<div class="breadcrumb" style="position:relative;top:0px;"> <div class="breadcrumb" style="position:relative;top:0px;">
<a href="#">Dashboard</a> <a href="#">Dashboard</a>
</div> </div>
<div class="menu">
<a ng-href="/new" class="nav-item add float-right"></a>
</div>
</div> </div>
<article> <article>
<section> <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 }}"> <a class="row build-row" ng-repeat="repo in repos | orderBy:'full_name'" ng-href="/{{ repo.full_name }}">
<div> <div>
<div class="build-num build-last success">&nbsp;</div> <div class="build-num build-last success">&nbsp;</div>

View file

@ -14,15 +14,22 @@
</div> </div>
<article> <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"> <div class="alert alert-error" ng-if="error !== undefined">
There was an error adding your repository. Please ensure the There was an error adding your repository. Please ensure the
repository exists and you have admin privileges. repository exists and you have admin privileges.
</div> </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>

View file

@ -25,25 +25,43 @@
<article> <article>
<section> <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> <div>
<label>Enable Pushes</label> <input id="trusted" type="checkbox" hidden="hidden" ng-model="repo.trusted" />
<input type="checkbox" ng-model="repo.post_commits" /> <label for="trusted" class="switch"></label>
</div> </div>
</div>
<div class="row">
<div>Timeout in minutes</div>
<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" /> <input type="number" ng-model="repo.timeout" />
</div> </div>
</div>
</section>
<section>
<form>
<ul> <ul>
<li ng-repeat="(key, value) in repo.params"> <li ng-repeat="(key, value) in repo.params">
<label>{{ key }}</label> <label>{{ key }}</label>
@ -65,6 +83,22 @@
</section> </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> <section>
<h2>Public Key</h2> <h2>Public Key</h2>
<div> <div>

View file

@ -813,6 +813,12 @@
content: "\f2e5"; content: "\f2e5";
} }
.nav-item.add:after {
font-size: 22px;
content: "\f0fd";
}
input.nav-item { input.nav-item {
position: relative; position: relative;
height: 59px; height: 59px;
@ -1368,16 +1374,16 @@ section .row:last-child > div {
section .build-row .build-num { section .build-row .build-num {
display: inline-block; display: inline-block;
width: 60px; width: 40px;
height:50px; height:40px;
line-height:50px; line-height:40px;
border-radius: 2px; border-radius: 50%;
color: rgba(255,255,255,0.9); color: rgba(255,255,255,0.9);
font-size: 16px; font-size: 16px;
text-align: center; text-align: center;
} }
section .build-row > div:last-child { section .build-row > div:last-child {
padding-left:5px; padding-left:0px;
} }
.pending, .pending,
@ -1403,8 +1409,8 @@ section .build-row > div:last-child {
} }
section .build-row > div:first-child { section .build-row > div:first-child {
width:90px; width:70px;
min-width: 90px; min-width: 70px;
} }
section .build-row h3 { section .build-row h3 {
@ -1446,9 +1452,9 @@ pre.key {
white-space: pre-wrap; white-space: pre-wrap;
word-wrap: break-word; word-wrap: break-word;
padding:30px; padding:30px;
font-size:14px; font-size:13px;
line-height:18px; line-height:18px;
color:#424242; color:#9E9E9E;
font-family: "Droid Sans Mono","Roboto","Arial"; font-family: "Droid Sans Mono","Roboto","Arial";
} }
@ -1456,6 +1462,23 @@ textarea:focus, input:focus{
outline: 0; 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 { .clearfix:after {
visibility: hidden; visibility: hidden;
display: block; 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);
}

View file

@ -49,7 +49,7 @@ type RepoCommit struct {
} }
type Perm struct { type Perm struct {
Pull bool Pull bool `json:"pull"`
Push bool Push bool `json:"push"`
Admin bool Admin bool `json:"admin"`
} }