Skip to content

Commit

Permalink
Merge pull request #489 from DemocracyEarth/daoverse
Browse files Browse the repository at this point in the history
Ragequit UI
  • Loading branch information
santisiri authored Dec 19, 2019
2 parents 92826df + 45e5417 commit f826f2a
Show file tree
Hide file tree
Showing 28 changed files with 506 additions and 183 deletions.
1 change: 0 additions & 1 deletion .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ meteorhacks:ssr
# miscellaneous
[email protected]
[email protected]
houston:admin
# meteortoys:allthings
edgee:slingshot
[email protected]
Expand Down
4 changes: 0 additions & 4 deletions .meteor/versions
26 changes: 17 additions & 9 deletions i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@
"empty-feed": "No events were found.",
"empty-votes": "No votes were cast.",
"posted-ideas": "Posted ideas",
"await-contract": "📄...",
"await-contract": "...",
"cast-votes": "Cast Votes",
"revoked-votes": "Revoked Votes",
"granted-votes": "Granted Votes",
Expand Down Expand Up @@ -531,7 +531,7 @@
"hashtag-tag-description": "All posts tagged {{hashtag}} on {{collective}}.",
"country-tag-title": "{{country}} posts on {{collective}}.",
"country-tag-description": "All posts from citizens of {{country}} on {{collective}}.",
"recent-activity": "Recent votes.",
"recent-activity": "Recent events.",
"bitcoin": "Bitcoin",
"fund-organization": "Fund Organization",
"btc": "BTC",
Expand Down Expand Up @@ -714,10 +714,10 @@
"duration": "Duration",
"blockchain-time-closing-criteria": "Poll ends when <strong>{{blockchain}}</strong> reaches a cycle of <strong>{{height}}</strong> cycles estimated on <strong>{{date}}</strong>.",
"blockchain-time-always-on": "This poll never ends and tallies an ongoing result.",
"countdown-expiration": "Poll ends in {{days}} {{hours}} {{minutes}} {{seconds}} (in {{blocks}})",
"countdown-queue": "Poll will begin in {{days}} {{hours}} {{minutes}} {{seconds}} (in {{blocks}})",
"countdown-grace": "Grace period ends in {{days}} {{hours}} {{minutes}} {{seconds}} (in {{blocks}})",
"countdown-process": "Poll and grace period ended. Proposal is ready to be processed.",
"countdown-expiration": "Poll ends in {{days}} {{hours}} (in {{blocks}})",
"countdown-queue": "Poll will begin in {{days}} {{hours}} (in {{blocks}})",
"countdown-grace": "Grace period ends in {{days}} {{hours}} (in {{blocks}})",
"countdown-process": "Proposal is ready to be processed.",
"periods-compressed": "cycles",
"periods-singular": "cycle",
"blocks-compressed": "blocks",
Expand Down Expand Up @@ -766,11 +766,12 @@
"moloch-process": "Ready for processing",
"moloch-period": "Period",
"moloch-results": "Results",
"moloch-map-submit-proposal": "<root><description json='{{details}}'></description> <request quantity='{{sharesRequested}}' token='SHARES'></request> <user _id='{{applicantId}}' username='{{applicant}}'></user> <tribute quantity='{{ether tokenTribute}}' token='WETH'></tribute></root>",
"moloch-map-submit-proposal": "<root><description json='{{details}}'></description> <request quantity='{{sharesRequested}}' token='MOLOCH'></request> <user _id='{{applicantId}}' username='{{applicant}}'></user> <tribute quantity='{{ether tokenTribute}}' token='WETH'></tribute></root>",
"moloch-map-rage-quit": "<root><ragequit quantity='{{sharesToBurn}}' token='MOLOCH'></ragequit></root>",
"moloch-yes": "Yes",
"moloch-no": "No",
"moloch-tribute": "Tribute to DAO",
"moloch-request": "Request by Applicant",
"moloch-request": "Shares requested",
"moloch-contract-parameters": "Decision variables.",
"moloch-applicant": "Applicant Address",
"moloch-contract-parameters-tooltip": "Changes that will apply to this DAO.",
Expand Down Expand Up @@ -805,5 +806,12 @@
"moloch-valid-voter": "You can vote",
"moloch-invalid-voter": "You are not a member",
"moloch-alert-not-member": "The address being used to vote is not a valid member of this DAO.",
"moloch-not-member": "Not a Member"
"moloch-not-member": "Not a Member",
"moloch-period-ragequit": "Ragequit",
"moloch-ragequit": "Ragequits",
"moloch-ragequit-shares-burn": "Burnt shares",
"moloch-ragequit-funds-withdraw": "Withdrawn Funds",
"quit": "Quit",
"moloch-contract-ragequit": "Retired shares from DAO.",
"moloch-contract-ragequit-tooltip": "A member has burned shares to withdraw funds from this DAO."
}
6 changes: 5 additions & 1 deletion imports/api/contracts/Contracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ Schema.Decision = new SimpleSchema({
type: String,
optional: true,
},
sharesToBurn: {
type: Number,
optional: true,
},
});

Schema.Contract = new SimpleSchema({
Expand Down Expand Up @@ -625,7 +629,7 @@ Schema.Contract = new SimpleSchema({
},
period: {
type: String,
allowedValues: ['PROCESS', 'QUEUE', 'VOTING', 'GRACE', 'ABORT', 'COMPLETE', 'PASSED', 'REJECTED', 'ABORTED'],
allowedValues: ['PROCESS', 'QUEUE', 'VOTING', 'GRACE', 'ABORT', 'COMPLETE', 'PASSED', 'REJECTED', 'ABORTED', 'RAGEQUIT'],
optional: true,
},
});
Expand Down
4 changes: 4 additions & 0 deletions imports/api/transactions/Transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ Schema.Transaction = new SimpleSchema({
type: String,
optional: true,
},
isRagequit: {
type: Boolean,
optional: true,
},
});

Transactions.attachSchema(Schema.Transaction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Template.balance.helpers({
Template.instance().coin = getCoin(Template.currentData().token);
const coin = Template.instance().coin;
if (coin.color) {
style = `background-color: ${coin.color}; border-color: ${coin.color};`;
style = `background-color: transparent; color: ${coin.color}; border-color: ${coin.color};`;
}
return style;
},
Expand Down
193 changes: 108 additions & 85 deletions imports/ui/templates/widgets/feed/feedItem.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,22 @@
</div>
</div>
<div class="data data-feed">
{{#if electionData}}
<img class="url-icon" src="{{getImage 'vote-icon-black'}}">
<a href="{{url}}#votes" class="verifier verifier-live verifier-feed">
{{voters}}
</a>
{{#if ragequit}}
<img class="url-icon" src="{{getImage 'ragequit-icon'}}">
<a href="/?period=ragequit" class="verifier verifier-live verifier-feed">
{{_ 'moloch-period-ragequit'}}
</a>
{{else}}
<div class="verifier verifier-live verifier-feed">
<div class="option-placeholder short"></div>
</div>
{{#if electionData}}
<img class="url-icon" src="{{getImage 'vote-icon-black'}}">
<a href="{{url}}#votes" class="verifier verifier-live verifier-feed">
{{voters}}
</a>
{{else}}
<div class="verifier verifier-live verifier-feed">
<div class="option-placeholder short"></div>
</div>
{{/if}}
{{/if}}
</div>
</div>
Expand All @@ -74,104 +81,120 @@
<div class="option-title option-link option-search title-input">
<div class="title-input title-feed {{focused}}">
{{#if moloch}}
{{{description}}}
<div class="election-rule">
{{{_ 'moloch-contract-parameters'}}}
{{> help tooltip='moloch-contract-parameters-tooltip'}}
</div>
<div class="smart-contract">
<div class="parameter">
<div class="parameter-name">
{{_ 'moloch-applicant'}}
</div>
<div class="parameter-value parameter-avatar">
{{#with applicant}}
{{> avatar size=36 profile=this._id includeName=true includeAddress=true includeNation=false editable=false microFont=true disabled=false includeRole=false}}
{{/with}}
{{#if ragequit}}
<div class="election-rule election-rule-top">
{{{_ 'moloch-contract-ragequit'}}}
{{> help tooltip='moloch-contract-ragequit-tooltip'}}
</div>
<div class="smart-contract">
<div class="parameter-line">
<div class="parameter">
<div class="parameter-name">
{{_ 'moloch-ragequit-shares-burn'}}
</div>
<div class="parameter-value parameter-token">
{{#with burn}}
{{> balance}}
{{/with}}
</div>
</div>
<!-- NOTE: to be done soon
<div class="parameter">
<div class="parameter-name">
{{_ 'moloch-ragequit-funds-withdraw'}}
</div>
<div class="parameter-value parameter-token">
{{#with withdraw}}
{{> balance}}
{{/with}}
</div>
</div>
-->
</div>
</div>
<div class="parameter-line">
{{else}}
{{{description}}}
<div class="election-rule">
{{{_ 'moloch-contract-parameters'}}}
{{> help tooltip='moloch-contract-parameters-tooltip'}}
</div>
<div class="smart-contract">
<div class="parameter">
<div class="parameter-name">
{{_ 'moloch-request'}}
{{_ 'moloch-applicant'}}
</div>
<div class="parameter-value parameter-token">
{{#with request}}
{{> balance}}
<div class="parameter-value parameter-avatar">
{{#with applicant}}
{{> avatar size=36 profile=this._id includeName=true includeAddress=true includeNation=false editable=false microFont=true disabled=false includeRole=false}}
{{/with}}
</div>
</div>
<div class="parameter">
<div class="parameter-name">
{{_ 'moloch-tribute'}}
<div class="parameter-line">
<div class="parameter">
<div class="parameter-name">
{{_ 'moloch-request'}}
</div>
<div class="parameter-value parameter-token">
{{#with request}}
{{> balance}}
{{/with}}
</div>
</div>
<div class="parameter-value parameter-token">
{{#with tribute}}
{{> balance}}
{{/with}}
<div class="parameter">
<div class="parameter-name">
{{_ 'moloch-tribute'}}
</div>
<div class="parameter-value parameter-token">
{{#with tribute}}
{{> balance}}
{{/with}}
</div>
</div>
</div>
</div>
</div>
{{/if}}
{{else}}
{{{title}}}
{{/if}}
</div>
</div>
</div>
{{#unless onChainVote}}
{{#if quadraticEnabled}}
<div class="election-rule">
{{{_ 'election-rule-quadratic'}}}
{{> help tooltip='voting-editor-quadratic-tooltip'}}
</div>
{{/if}}
{{#if balanceEnabled}}
<div class="election-rule">
{{{_ 'election-rule-balance'}}}
{{> help tooltip='voting-editor-balance-tooltip'}}
</div>
{{/if}}
{{else}}
<div class="election-rule">
{{{_ 'election-rule-onchain'}}}
{{> help tooltip='voting-editor-onchain-tooltip'}}
</div>
{{/unless}}

{{#if requiresClosing}}
{{#with closingData}}
{{> countdown}}
{{/with}}
{{/if}}

{{#if pollingEnabled}}
{{> poll list=pollList pollId=pollId rules=rules pollTotals=pollTotals quadratic=quadraticEnabled balance=balanceEnabled}}
{{else}}
{{> poll list=pollList placeholder=true}}
{{/if}}

{{#if tally}}
{{> ballot editorMode=false feedMode=true contract=feedContract url=url rightToVote=rightToVote candidateBallot=candidateBallot displayResults=displayResults readOnly=readOnly displayActions=displayActions rules=rules}}
{{else}}
<!-- NOTE: depreceated stuff
{{#if electionData}}
{{#if onScreen}}
{{> ballot editorMode=false feedMode=true contract=feedContract url=url rightToVote=rightToVote candidateBallot=candidateBallot displayResults=displayResults readOnly=readOnly displayActions=displayActions rules=rules}}
{{else}}
{{#nrr nrrargs 'ballot' editorMode=false feedMode=true contract=feedContract url=url rightToVote=rightToVote candidateBallot=candidateBallot displayResults=displayResults readOnly=readOnly displayActions=displayActions rules=rules}}{{/nrr}}
{{/if}}
{{else}}
{{#if currentUser}}
<div class="extra">
<div class="warning download">
{{_ 'get-election-votes'}}
{{> spinner id=_id style=spinnerStyle}}
{{#unless ragequit}}
<div class="title-input title-feed title-ballot">
{{#unless onChainVote}}
{{#if quadraticEnabled}}
<div class="election-rule">
{{{_ 'election-rule-quadratic'}}}
{{> help tooltip='voting-editor-quadratic-tooltip'}}
</div>
{{/if}}
{{#if balanceEnabled}}
<div class="election-rule">
{{{_ 'election-rule-balance'}}}
{{> help tooltip='voting-editor-balance-tooltip'}}
</div>
{{/if}}
{{else}}
<div class="election-rule">
{{{_ 'election-rule-onchain'}}}
{{> help tooltip='voting-editor-onchain-tooltip'}}
</div>
{{/unless}}
</div>
{{#if requiresClosing}}
{{#with closingData}}
{{> countdown}}
{{/with}}
{{/if}}
{{#if pollingEnabled}}
{{> poll list=pollList pollId=pollId rules=rules pollTotals=pollTotals quadratic=quadraticEnabled balance=balanceEnabled}}
{{else}}
{{> poll list=pollList placeholder=true}}
{{/if}}
{{/if}}-->
{{/if}}
{{#if tally}}
{{> ballot editorMode=false feedMode=true contract=feedContract url=url rightToVote=rightToVote candidateBallot=candidateBallot displayResults=displayResults readOnly=readOnly displayActions=displayActions rules=rules}}
{{/if}}
{{/unless}}
</div>
</div>
{{#unless isPhone}}
Expand Down
Loading

0 comments on commit f826f2a

Please sign in to comment.