Skip to content

Commit

Permalink
Bounty view
Browse files Browse the repository at this point in the history
  • Loading branch information
grandsmarquis committed Jan 26, 2019
1 parent 8bd559e commit 40e43e0
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 45 deletions.
8 changes: 8 additions & 0 deletions api/controllers/dapps/BountiesController.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ module.exports = {
return (res.view('dapps/bounties/index', {
}));
},
index: async function(req, res) {
return (res.view('dapps/bounties/bounty', {
}));
},
activity: async function(req, res) {
var results = await sails.helpers.dapps.bounties.activity.with(req.query);
return (res.json(results));
},
activityBounty: async function(req, res) {
var results = await sails.helpers.dapps.bounties.activity.with(req.query);
return (res.json(results));
},
}
40 changes: 40 additions & 0 deletions api/helpers/dapps/bounties/activity-bounty.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

module.exports = {

friendlyName: 'Get all the tokens',
description: 'Return the list of the tokens.',

inputs: {
'limit': {
type: 'number',
example: 10,
description: 'The nquery to execute.',
required: false,
defaultsTo: 10,
},
'page': {
type: 'number',
example: 2,
description: 'The nquery to execute.',
required: false,
defaultsTo: 0,
},
'bounty': {
type: 'number',
example: 2,
description: 'The nquery to execute.',
required: true,
},
},

fn: async function (inputs, exits) {
console.log(inputs)
var knex = await sails.helpers.db.getknex();
var base = knex.select('*').from('dapp_bounties_network').where('bounty_id', inputs.bounty);
var results = await base.paginate(inputs['limit'], inputs['page'], true);
results.count = results.total;
return exits.success(results);

}

};
4 changes: 2 additions & 2 deletions assets/js/components/dapps/bounties/bounty_link.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ parasails.registerComponent('bounty-link', {
},

template: `
<a target="_blank" :href="bounty_id | makeLink" >
<a :href="bounty_id | makeLink" >
{{bounty_id}}
</a>
`,
Expand All @@ -28,7 +28,7 @@ parasails.registerComponent('bounty-link', {

filters: {
makeLink: function(value) {
return ("https://explorer.bounties.network/bounty/" + value);
return ("/dapp/bounties/bounty/" + value);
},

},
Expand Down
31 changes: 31 additions & 0 deletions assets/js/pages/dapps/bounties/bounty.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
parasails.registerPage('page_dapp_bounties_bounty', {

data: {
columns: [
'timestamp',
'bounty_id',
'type',
],
options: {
filterable: false,
perPageValues: [25, 50, 100, 500],
perPage: 25,
headings: {
'timestamp': 'Date',
'bounty_id': 'Bounty',
}
}
},

beforeMount: function() {
console.log('before monted')
},

mounted: function() {
console.log("Successfully mounted")
},

methods: {

}
});
2 changes: 2 additions & 0 deletions config/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ module.exports.routes = {
'/api/dapp/compound/distribution/token': 'dapps/CompoundController.distributionActivityToken',

//Bounties Network
'/dapp/bounties/bounty/:id': 'dapps/BountiesController.bounty',
'/dapp/bounties': 'dapps/BountiesController.index',
'/api/dapp/bounties/activity': 'dapps/BountiesController.activity',
'/api/dapp/bounties/activity/:bounty_id': 'dapps/BountiesController.activityBounty',


// PUBLIC API
Expand Down
32 changes: 32 additions & 0 deletions views/dapps/bounties/bounty.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<div id="page_dapp_bounties_bounty" class="container " style="margin-top: 20px; margin-bottom: 20px; ">
<div class="card" style="padding: 20px;">
<h3 class="title"><img src="/images/dapps/bounties.png" style="height: 0.8em; margin-right: 20px;"></img>The Bounties Network</h3>
<p>The <strong>Bounties Network</strong> empowers humans to incentivize and self-organize, from freelancing to grassroots social action, and anything in between. Whether it's for research, content translation, or video production, The Bounties Network lets you create projects, collaborate, and get paid for doing great work in any domain.</p>
<hr>
<h3 class="title is-4">Activity</h3>
<v-server-table url="/api/dapp/bounties/activity" :columns="columns" :options="options">
<center slot="timestamp" slot-scope="props">
<from-now :timestamp="props.row.timestamp"></from-now>
</center>
<center slot="bounty_id" slot-scope="props">
<bounty-link :bounty_id="props.row.bounty_id"></bounty-link>
</center>
<center slot="type" slot-scope="props">
<p v-if="props.row.type =='BountyIssued'" style="color: #000000">Bounty Issued</p>
<p v-if="props.row.type =='ContributionAdded'"><span style="color: #000000">Contribution Added</span> by <address_etherscan_link :address="props.row.topic_1"></address_etherscan_link></p>
<p v-if="props.row.type =='BountyActivated'" style="color: #000000">Bounty Activated</p>
<p v-if="props.row.type =='BountyFulfilled'" ><span style="color: #1e88e5">Bounty Fulfilled</span> by <address_etherscan_link :address="props.row.topic_1"></address_etherscan_link></p>
<p v-if="props.row.type =='FulfillmentAccepted'" ><span style="color: #558b2f">Fulfillment Accepted</span> by <address_etherscan_link :address="props.row.topic_1"></address_etherscan_link></p>
<p v-if="props.row.type =='PaymentIncreased'" style="color: #000000">Payment Increased</p>
<p v-if="props.row.type =='BountyKilled'" style="color: #000000">Bounty Killed</p>
<p v-if="props.row.type =='BountyChanged'" style="color: #000000">Bounty Changed</p>
<p v-if="props.row.type =='IssuerTransferred'" style="color: #000000">Issuer Transferred</p>
<p v-if="props.row.type =='DeadlineExtended'" style="color: #000000">Deadline Extended</p>
</center>
<center slot="name" slot-scope="props">
<strong>{{props.row.name}}</strong> ({{props.row.symbol}})
</center>

</v-server-table>
</div>
</div>
87 changes: 44 additions & 43 deletions views/layouts/layout.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
<meta name="keywords" content="<%=typeof description == 'undefined' ? 'DAppBoard' : description%>" />

<!--STYLES-->
<link rel="stylesheet" href="/styles/bulma-tooltip.min.css?v=1548498094567">
<link rel="stylesheet" href="/styles/bulma.min.css?v=1548498094567">
<link rel="stylesheet" href="/styles/c3.css?v=1548498094567">
<link rel="stylesheet" href="/styles/date-range-picker.css?v=1548498094567">
<link rel="stylesheet" href="/styles/font-awesome.css?v=1548498094567">
<link rel="stylesheet" href="/styles/general.css?v=1548498094567">
<link rel="stylesheet" href="/styles/importer.css?v=1548498094567">
<link rel="stylesheet" href="/styles/office.css?v=1548498094567">
<link rel="stylesheet" href="/styles/bulma-tooltip.min.css?v=1548519437594">
<link rel="stylesheet" href="/styles/bulma.min.css?v=1548519437594">
<link rel="stylesheet" href="/styles/c3.css?v=1548519437594">
<link rel="stylesheet" href="/styles/date-range-picker.css?v=1548519437594">
<link rel="stylesheet" href="/styles/font-awesome.css?v=1548519437594">
<link rel="stylesheet" href="/styles/general.css?v=1548519437594">
<link rel="stylesheet" href="/styles/importer.css?v=1548519437594">
<link rel="stylesheet" href="/styles/office.css?v=1548519437594">
<!--STYLES END-->

<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet">
Expand All @@ -37,41 +37,42 @@


<!--SCRIPTS-->
<script src="/dependencies/sails.io.js?v=1548498094567"></script>
<script src="/dependencies/jquery.js?v=1548498094567"></script>
<script src="/dependencies/lodash.js?v=1548498094567"></script>
<script src="/dependencies/moment.js?v=1548498094567"></script>
<script src="/dependencies/d3.js?v=1548498094567"></script>
<script src="/dependencies/c3.js?v=1548498094567"></script>
<script src="/dependencies/vue.js?v=1548498094567"></script>
<script src="/dependencies/vue-table.js?v=1548498094567"></script>
<script src="/dependencies/vue-trend.js?v=1548498094567"></script>
<script src="/dependencies/vue-typer.js?v=1548498094567"></script>
<script src="/dependencies/parasails.js?v=1548498094567"></script>
<script src="/dependencies/chart.js?v=1548498094567"></script>
<script src="/dependencies/colorhash.js?v=1548498094567"></script>
<script src="/dependencies/daterangepicker.js?v=1548498094567"></script>
<script src="/dependencies/global_helpers.js?v=1548498094567"></script>
<script src="/dependencies/global_tooltips.js?v=1548498094567"></script>
<script src="/js/components/address/adress_etherscan_link.js?v=1548498094567"></script>
<script src="/js/components/contracts/contract_icon.js?v=1548498094567"></script>
<script src="/js/components/contracts/contract_image.js?v=1548498094567"></script>
<script src="/js/components/dapps/bounties/bounty_link.js?v=1548498094567"></script>
<script src="/js/components/dapps/zrx/tradingPair.js?v=1548498094567"></script>
<script src="/js/components/date/from-now.js?v=1548498094567"></script>
<script src="/js/components/general/general_trend_line.js?v=1548498094567"></script>
<script src="/js/components/office/office_token_edit.js?v=1548498094567"></script>
<script src="/js/components/tokens/token_image.js?v=1548498094567"></script>
<script src="/js/pages/contracts/contracts_token_page_nfts.js?v=1548498094567"></script>
<script src="/js/pages/contracts/contracts_token_page_users.js?v=1548498094567"></script>
<script src="/js/pages/contracts/contracts_token_page.js?v=1548498094567"></script>
<script src="/js/pages/contracts/contracts_token.js?v=1548498094567"></script>
<script src="/js/pages/dapps/bounties/index.js?v=1548498094567"></script>
<script src="/js/pages/dapps/compound/index.js?v=1548498094567"></script>
<script src="/js/pages/dapps/zrx/index.js?v=1548498094567"></script>
<script src="/js/pages/landing/home.js?v=1548498094567"></script>
<script src="/js/pages/office/tokens.js?v=1548498094567"></script>
<script src="/js/pages/tokens/tokens_list.js?v=1548498094567"></script>
<script src="/dependencies/sails.io.js?v=1548519437594"></script>
<script src="/dependencies/jquery.js?v=1548519437594"></script>
<script src="/dependencies/lodash.js?v=1548519437594"></script>
<script src="/dependencies/moment.js?v=1548519437594"></script>
<script src="/dependencies/d3.js?v=1548519437594"></script>
<script src="/dependencies/c3.js?v=1548519437594"></script>
<script src="/dependencies/vue.js?v=1548519437594"></script>
<script src="/dependencies/vue-table.js?v=1548519437594"></script>
<script src="/dependencies/vue-trend.js?v=1548519437594"></script>
<script src="/dependencies/vue-typer.js?v=1548519437594"></script>
<script src="/dependencies/parasails.js?v=1548519437594"></script>
<script src="/dependencies/chart.js?v=1548519437594"></script>
<script src="/dependencies/colorhash.js?v=1548519437594"></script>
<script src="/dependencies/daterangepicker.js?v=1548519437594"></script>
<script src="/dependencies/global_helpers.js?v=1548519437594"></script>
<script src="/dependencies/global_tooltips.js?v=1548519437594"></script>
<script src="/js/components/address/adress_etherscan_link.js?v=1548519437594"></script>
<script src="/js/components/contracts/contract_icon.js?v=1548519437594"></script>
<script src="/js/components/contracts/contract_image.js?v=1548519437594"></script>
<script src="/js/components/dapps/bounties/bounty_link.js?v=1548519437594"></script>
<script src="/js/components/dapps/zrx/tradingPair.js?v=1548519437594"></script>
<script src="/js/components/date/from-now.js?v=1548519437594"></script>
<script src="/js/components/general/general_trend_line.js?v=1548519437594"></script>
<script src="/js/components/office/office_token_edit.js?v=1548519437594"></script>
<script src="/js/components/tokens/token_image.js?v=1548519437594"></script>
<script src="/js/pages/contracts/contracts_token_page_nfts.js?v=1548519437594"></script>
<script src="/js/pages/contracts/contracts_token_page_users.js?v=1548519437594"></script>
<script src="/js/pages/contracts/contracts_token_page.js?v=1548519437594"></script>
<script src="/js/pages/contracts/contracts_token.js?v=1548519437594"></script>
<script src="/js/pages/dapps/bounties/bounty.js?v=1548519437594"></script>
<script src="/js/pages/dapps/bounties/index.js?v=1548519437594"></script>
<script src="/js/pages/dapps/compound/index.js?v=1548519437594"></script>
<script src="/js/pages/dapps/zrx/index.js?v=1548519437594"></script>
<script src="/js/pages/landing/home.js?v=1548519437594"></script>
<script src="/js/pages/office/tokens.js?v=1548519437594"></script>
<script src="/js/pages/tokens/tokens_list.js?v=1548519437594"></script>
<!--SCRIPTS END-->

<!-- Global site tag (gtag.js) - Google Analytics -->
Expand Down

0 comments on commit 40e43e0

Please sign in to comment.