Skip to content
Browse files

added 'info' field to projects.json, improved look of modal

  • Loading branch information...
1 parent 7c4927a commit 9196c7c7c6dbce48cf31be93ca16bf486f1b3da1 @btford committed Jun 26, 2012
Showing with 21 additions and 9 deletions.
  1. +1 −0 README.md
  2. +4 −0 css/bwa.css
  3. +5 −2 index.html
  4. +10 −6 js/bwa.js
  5. +1 −1 projects/projects.json
View
1 README.md
@@ -14,6 +14,7 @@ Adding your neat thing
"thumb": "my-app/thumb.png", // path to the image (omit the projects/ prefix)
"desc": "Description of your app", // One or two sentences
"url": "http://myapp.com", // url to your app
+ "info": "http://myapp.com/blog", // url to explanation of app
"src": "https://github.com/me/myapp", // (optional) Url to your source repository
"submitter": "IgorMinar", // your github username
"submissionDate": "2012-05-24", // current date in ISO format
View
4 css/bwa.css
@@ -108,11 +108,15 @@ img.AngularJS-large {
.modal-body img {
width: 580px;
height: 400px;
+ padding: 20px;
}
.modal-body {
text-align: center;
max-height: 100%;
}
+.modal-body p {
+ padding: 20px;
+}
.modal.fade.in {
top: 40%;
}
View
7 index.html
@@ -245,15 +245,18 @@
<h2>{{lightbox().name}}</h2>
</div>
<div class="modal-body">
- <img alt="{{lightbox() && lightbox().name + ' screenshot'}}" ng-src="{{lightbox() && 'projects/' + lightbox().thumb}}">
+ <a href="{{lightbox().url}}">
+ <img alt="{{lightbox() && lightbox().name + ' screenshot'}}" class="well" ng-src="{{lightbox() && 'projects/' + lightbox().thumb}}">
+ </a>
<p>{{lightbox().desc}}</p>
<p>
<span class="label label-info bwa-tag" ng-repeat="tag in lightbox().tags">{{tag}}</span>
</p>
</div>
<div class="modal-footer">
+ <a href="{{lightbox().url}}" class="btn btn-primary">Check out the App</a>
<a ng-show="lightbox().src" href="{{lightbox().src}}" class="btn">View the Source</a>
- <a href="{{lightbox().url}}" class="btn btn-primary">Visit the site</a>
+ <a ng-show="lightbox().info" href="{{lightbox().info}}" class="btn">Read More</a>
</div>
</div>
<div class="modal-backdrop fade" ng-class="{in: lightbox()}" ng-click='lightbox(false)'></div>
View
16 js/bwa.js
@@ -39,15 +39,20 @@ app.controller('BWAController', function ($scope, $http, $filter) {
lightbox = ev.state;
$scope.$apply();
};
+ window.onkeydown = function (ev) {
+ if (ev.keyCode === 27 && lightbox) {
+ $scope.lightbox(false);
+ $scope.$apply();
+ }
+ }
$scope.lightbox = function (arg) {
if (typeof arg !== 'undefined') {
if (arg !== false) {
- history.pushState(arg, null, 'project/' + arg.name);
+ history.pushState(arg, null, 'project/' + arg.id);
} else {
history.pushState(false, null, '/');
}
lightbox = arg;
- console.log(arg);
}
return lightbox;
};
@@ -61,8 +66,6 @@ app.controller('BWAController', function ($scope, $http, $filter) {
for (var i = $scope.projects.length - 1; i >= 0; i--) {
if (data.projects[i].name === data.featured) {
$scope.featured = data.projects[i];
- // TODO: remove featured project from search?
- // $scope.projects.slice ...
break;
}
}
@@ -76,6 +79,7 @@ app.controller('BWAController', function ($scope, $http, $filter) {
// add tags
angular.forEach(data.projects, function (project) {
+ project.id = project.name.replace(' ', '-');
angular.forEach(project.tags, function (tag) {
// ensure tags are unique
@@ -89,9 +93,9 @@ app.controller('BWAController', function ($scope, $http, $filter) {
$scope.search();
if (document.location.pathname.substr(0, 9) === '/project/') {
- var projectName = document.location.pathname.substr(9).replace('%20', ' ');
+ var projectName = document.location.pathname.substr(9);
data.projects.forEach(function (project) {
- if (project.name === projectName) {
+ if (project.id === projectName) {
lightbox = project;
}
});
View
2 projects/projects.json
@@ -197,7 +197,7 @@
"thumb": "ptr/thumb.png",
"desc": "Time sheet for recoring working hours and time allocation to projects.",
"url": "http://www.sekas.de/ptr",
- "announcement": "http://www.sekas.de/sekas_blog.html",
+ "info": "http://www.sekas.de/sekas_blog.html",
"submitter": "Paul Bininda",
"submissionDate": "2012-06-14",
"tags": [

0 comments on commit 9196c7c

Please sign in to comment.
Something went wrong with that request. Please try again.