Skip to content

Commit

Permalink
feat(links-text): add show text also in broken links
Browse files Browse the repository at this point in the history
  • Loading branch information
kodekracker committed Jul 31, 2014
1 parent cd8fcbb commit e1fb630
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 123 deletions.
3 changes: 1 addition & 2 deletions rottoscraper/gui/static/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ app.controller('RottoController',function($scope,$location,$http){
};

$scope.cancelRequest = function(){
console.log('cancel');
$location.url('/');
$location.url('/cancel', '/');
};

$scope.submitRequest = function(){
Expand Down
50 changes: 31 additions & 19 deletions rottoscraper/gui/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ body {
width: 100%;
height: 100%;
background: #555 url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAB9JREFUeNpi/P//PwM6YGLAAuCCmpqacC2MRGsHCDAA+fIHfeQbO8kAAAAASUVORK5CYII=);
font: 30px 'Lucida sans', Arial, Helvetica;
font-family: 'Raleway', sans-serif;
font-size: 30px;
color: #eee;
background-color: #5A5A5A;
}

a {
a , a:visited{
color: #ffffff;
text-decoration: none;
}

a:visited , a:hover{
a:hover{
color: #C0C0C0;
text-decoration: none;
}
Expand Down Expand Up @@ -90,6 +91,10 @@ footer small{
overflow: hidden;
}

.main-page{
margin: 80px auto;
}

.wrapper{
width: 100%;
height: 100%;
Expand Down Expand Up @@ -127,7 +132,6 @@ footer small{
margin: 0;
height: 100%;
width: 100%;
padding: 3px;
}


Expand All @@ -139,34 +143,33 @@ footer small{
display: none;
}

.user-form-data{
padding: 30px 20px;
}

.user-form-data-head{

text-align: center;
font-size: 20px;
color: #ffffff;
padding: 10px;
}
.user-form-data-head table{
.user-form-data-content table{
width: 100%;
}

.user-form-data-head table tr{
height: 40px;
.user-form-data-content table tr{
height: 40px;
}

.user-form-data-head table tr td{
.user-form-data-content table tr td{
text-align: left;
color: #ffffff;
font-size: 0.7em;
}

.user-form-data-head table tr td:first-child{
.user-form-data-content table tr td:first-child{
text-align: right;
padding: 0px 15px;
}

.button-box{
margin: 20px 0px;
margin: 50px 0px;
}

.fancy-button{
Expand Down Expand Up @@ -380,9 +383,13 @@ height: 40px;


/* result.html css */

.result-box{
.result-page{
width: 100%;
margin: 10px auto;
}

.simple-font{
font-family: sans-serif;
}
.result{
font-size: 0.5em;
Expand All @@ -401,10 +408,12 @@ height: 40px;
.result-head tr td:first-child{
text-align: right;
font-size: 0.8em;
width: 30%;
}
.result-head td{
.result-head tr td:last-child{
text-align: left;
padding: 0px 10px;
padding: 0px 10px;
width: 70%;
}

.focus{
Expand Down Expand Up @@ -440,6 +449,9 @@ background-color: rgba(61, 59, 59, 0.55);
padding: 8px 0px;
}

.link-text{
color: #13db8e;
}
.keyword{
float:left;
margin: 2px;
Expand Down
140 changes: 71 additions & 69 deletions rottoscraper/gui/static/html/index.html
Original file line number Diff line number Diff line change
@@ -1,75 +1,77 @@
<div class="user-form" ng-show="formFilling">
<div class="steps-nav">
<ul>
<li class="cursor" ng-class="{true:'nav-selected'}[currentStepId==1]" ng-click="showStep(1)">
<p>Step 1</p>
</li>
<li class="cursor" ng-class="{true:'nav-selected'}[currentStepId==2]" ng-click="showStep(2)">
<p>Step 2</p>
</li>
<li class="cursor" ng-class="{true:'nav-selected'}[currentStepId==3]" ng-click="showStep(3)">
<p>Step 3</p>
</li>
</ul>
</div>
<div class="main-page">
<div class="user-form" ng-show="formFilling">
<div class="steps-nav">
<ul>
<li class="cursor" ng-class="{true:'nav-selected'}[currentStepId==1]" ng-click="showStep(1)">
<p>Step 1</p>
</li>
<li class="cursor" ng-class="{true:'nav-selected'}[currentStepId==2]" ng-click="showStep(2)">
<p>Step 2</p>
</li>
<li class="cursor" ng-class="{true:'nav-selected'}[currentStepId==3]" ng-click="showStep(3)">
<p>Step 3</p>
</li>
</ul>
</div>

<div class="steps-form" >
<form name="crawlForm" method="POST">
<div class="fancy-box form-wrapper step" ng-class="{true:'step-selected',false:'step-unselected'}[currentStepId==1]">
<label for="url">URL</label>
<input type="url" ng-model="url" name="url" class="form-control" placeholder="http:// or https://" required>
<button class="btn btn-default" ng-click="showStep(2)" >Next</button>
</div>
<div class="fancy-box form-wrapper step" ng-class="{true:'step-selected',false:'step-unselected'}[currentStepId==2]">
<label for="keywords">Keywords</label>
<tags-input ng-model="keywords"></tags-input>
<button class="btn btn-default" ng-click="showStep(3)" >Next</button>
</div>
<div class="fancy-box form-wrapper step" ng-class="{true:'step-selected',false:'step-unselected'}[currentStepId==3]">
<label for="email">Email-Id</label>
<input type="email" ng-model="email" name="email" class="form-control" placeholder="Enter a email address" required>
<button type="submit" class="btn btn-default" ng-click="confirmFormDetails(crawlForm.$valid)">Submit</button>
</div>
</form>
<div class="steps-form" >
<form name="crawlForm" method="POST">
<div class="fancy-box form-wrapper step" ng-class="{true:'step-selected',false:'step-unselected'}[currentStepId==1]">
<label for="url">URL</label>
<input type="url" ng-model="url" name="url" class="form-control" placeholder="http:// or https://" required>
<button class="btn btn-default" ng-click="showStep(2)" >Next</button>
</div>
<div class="fancy-box form-wrapper step" ng-class="{true:'step-selected',false:'step-unselected'}[currentStepId==2]">
<label for="keywords">Keywords</label>
<tags-input ng-model="keywords"></tags-input>
<button class="btn btn-default" ng-click="showStep(3)" >Next</button>
</div>
<div class="fancy-box form-wrapper step" ng-class="{true:'step-selected',false:'step-unselected'}[currentStepId==3]">
<label for="email">Email-Id</label>
<input type="email" ng-model="email" name="email" class="form-control" placeholder="Enter a email address" required>
<button type="submit" class="btn btn-default" ng-click="confirmFormDetails(crawlForm.$valid)">Submit</button>
</div>
</form>
</div>
</div>
</div>
<div class="user-form-data" ng-show="confirmDetails">
<div class="user-form-data-head fancy-box">
<table>
<tr>
<td><span class="focus">Url:</span></td>
<td>{{userDetails.url}}</td>
</tr>
<tr>
<td><span class="focus">Keywords:</span></td>
<td>
<div class="keyword" ng-if="userDetails.keywords.length!=0" ng-repeat="keyword in userDetails.keywords">
<span class="glyphicon glyphicon-tag"></span>
<span>{{keyword}}</span>
</div>
<div ng-if="userDetails.keywords.length==0">
No Keyword
</div>
</td>
</tr>
<tr>
<td><span class="focus">Email-Id:</span></td>
<td>{{userDetails.email_id}}</td>
</tr>
</table>
<div class="user-form-data" ng-show="confirmDetails">
<div class="user-form-data-head">Review Details</div>
<div class="user-form-data-content fancy-box">
<table>
<tr>
<td><span class="focus">Url:</span></td>
<td>{{userDetails.url}}</td>
</tr>
<tr>
<td><span class="focus">Keywords:</span></td>
<td>
<div class="keyword" ng-if="userDetails.keywords.length!=0" ng-repeat="keyword in userDetails.keywords">
<span class="glyphicon glyphicon-tag"></span>
<span>{{keyword}}</span>
</div>
<div ng-if="userDetails.keywords.length==0">
No Keyword
</div>
</td>
</tr>
<tr>
<td><span class="focus">Email-Id:</span></td>
<td>{{userDetails.email_id}}</td>
</tr>
</table>
</div>
<div class="button-box">
<button type="submit" class="btn btn-default fancy-button cancel" ng-click="cancelRequest()">Cancel</button>
<button type="submit" class="btn btn-default fancy-button process" ng-click="submitRequest()">Process</button>
</div>
</div>
<div class="button-box">
<button type="submit" class="btn btn-default fancy-button cancel" ng-click="cancelRequest()">Cancel</button>
<button type="submit" class="btn btn-default fancy-button process" ng-click="submitRequest()">Process</button>
<div class="message fancy-box" ng-show="showMessage" >
<h3>Your Request is in Queue</h3>
<p>We will get back to you soon with some solid result. Checkout your email-Id after few moments.</p>
</div>
<div class="message fancy-box" ng-show="error.status" >
<h3>Error Occured in sending request</h3>
<p>{{error.message}}</p>
</div>
</div>
<div class="message fancy-box" ng-show="showMessage" >
<h3>Your Request is in Queue</h3>
<p>We will get back to you soon with some solid result. Checkout your email-Id after few moments.</p>
</div>
<div class="message fancy-box" ng-show="error.status" >
<h3>Error Occured in sending request</h3>
<p>{{error.message}}</p>
</div>


11 changes: 7 additions & 4 deletions rottoscraper/gui/static/html/result.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="result-box">
<div class="result-page">
<div class="msg" ng-if="error.status">
<p>{{ error.message }}</p>
</div>
Expand All @@ -23,15 +23,15 @@
</tr>
<tr>
<td><span class="focus">Website Id: </span></td>
<td>{{ website.id }}</td>
<td class="simple-font">{{ website.id }}</td>
</tr>
<tr>
<td><span class="focus">Job Status:</span></td>
<td>{{ website.status.toUpperCase() }}</td>
</tr>
<tr>
<td><span class="focus">Last Time Crawled:</span></td>
<td>{{ website.last_time_crawled }}</td>
<td class="simple-font"> {{ website.last_time_crawled }}</td>
</tr>
</table>
</div>
Expand All @@ -51,7 +51,10 @@
<td></td>
<td><span class="focus">Rotto Url's:</span></td>
<td>
<div class="rotto-row" ng-repeat="rottourl in rottopage.rotto_links">{{$index+1}})&nbsp<a href="{{rottourl}}" target="_blank">{{rottourl}}</a></div>
<div class="rotto-row" ng-repeat="link in rottopage.rotto_links">{{$index+1}})&nbsp
<a href="{{link.url}}" target="_blank">{{link.url}}</a>
<span class='link-text' ng-if="link.text">[{{link.text}}]</span>
</div>
</td>
</tr>
<tr>
Expand Down
3 changes: 2 additions & 1 deletion rottoscraper/gui/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
<link rel="stylesheet" type="text/css" href="static/css/bootstrap-theme.min.css" />
<link rel="stylesheet" type="text/css" href="static/css/ng-tags-input.min.css" />
<link rel="stylesheet" type="text/css" href="static/css/style.css" />
<link href='http://fonts.googleapis.com/css?family=Raleway:500' rel='stylesheet' type='text/css'>
</head>

<body ng-app="RottoApp">

<div class="wrapper">
<header>
<a href="#/"><h2>Rotto Link Scraper V1.0</h2></a>
<a href="#/"><h2>Rotto Link Scraper</h2></a>
</header>
{% block body %}{% endblock %}
<footer >
Expand Down
Loading

0 comments on commit e1fb630

Please sign in to comment.