Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
CCS Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiphon
CCS Backend
Commits
997acbfe
Commit
997acbfe
authored
Mar 05, 2019
by
xiphon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
project: fix raised_amount, drop amount_received field
parent
95260c71
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
12 deletions
+12
-12
app/Console/Commands/UpdateSiteProposals.php
app/Console/Commands/UpdateSiteProposals.php
+2
-2
app/Http/Resources/ProjectResource.php
app/Http/Resources/ProjectResource.php
+1
-1
app/Project.php
app/Project.php
+2
-2
gitlab/Connection.php
gitlab/Connection.php
+3
-3
resources/views/projects/index.blade.php
resources/views/projects/index.blade.php
+2
-2
resources/views/projects/show.blade.php
resources/views/projects/show.blade.php
+2
-2
No files found.
app/Console/Commands/UpdateSiteProposals.php
View file @
997acbfe
...
@@ -78,7 +78,7 @@ class UpdateSiteProposals extends Command
...
@@ -78,7 +78,7 @@ class UpdateSiteProposals extends Command
if
(
basename
(
$filename
)
!=
$filename
)
{
if
(
basename
(
$filename
)
!=
$filename
)
{
$this
->
error
(
"Skipping MR #
$mergeRequest->id
'
$mergeRequest->title
':
$filename
must be in the root folder"
);
$this
->
error
(
"Skipping MR #
$mergeRequest->id
'
$mergeRequest->title
':
$filename
must be in the root folder"
);
continue
;
continue
;
}
}
if
(
in_array
(
$filename
,
$ideas
))
{
if
(
in_array
(
$filename
,
$ideas
))
{
$this
->
error
(
"Skipping MR #
$mergeRequest->id
'
$mergeRequest->title
': duplicated
$filename
, another MR #
$ideas[$filename]
->id"
);
$this
->
error
(
"Skipping MR #
$mergeRequest->id
'
$mergeRequest->title
': duplicated
$filename
, another MR #
$ideas[$filename]
->id"
);
continue
;
continue
;
...
@@ -116,7 +116,7 @@ class UpdateSiteProposals extends Command
...
@@ -116,7 +116,7 @@ class UpdateSiteProposals extends Command
$prop
->
{
'milestones-percentage'
}
=
$milestones_percentage
;
$prop
->
{
'milestones-percentage'
}
=
$milestones_percentage
;
$prop
->
percentage
=
$proposal
->
percentage_funded
;
$prop
->
percentage
=
$proposal
->
percentage_funded
;
$prop
->
amount
=
$proposal
->
target_amount
;
$prop
->
amount
=
$proposal
->
target_amount
;
$prop
->
{
'amount-funded'
}
=
$proposal
->
amount_received
;
$prop
->
{
'amount-funded'
}
=
$proposal
->
raised_amount
;
$prop
->
author
=
$proposal
->
author
;
$prop
->
author
=
$proposal
->
author
;
$prop
->
date
=
$proposal
->
created_at
->
format
(
'F j, Y'
);
$prop
->
date
=
$proposal
->
created_at
->
format
(
'F j, Y'
);
return
$prop
;
return
$prop
;
...
...
app/Http/Resources/ProjectResource.php
View file @
997acbfe
...
@@ -17,7 +17,7 @@ class ProjectResource extends JsonResource
...
@@ -17,7 +17,7 @@ class ProjectResource extends JsonResource
return
[
return
[
'subaddr_index'
=>
$this
->
subaddr_index
,
'subaddr_index'
=>
$this
->
subaddr_index
,
'status'
=>
$this
->
status
,
'status'
=>
$this
->
status
,
'
amount_received'
=>
$this
->
amount_received
,
'
raised_amount'
=>
$this
->
raised_amount
,
'target_amount'
=>
$this
->
target_amount
,
'target_amount'
=>
$this
->
target_amount
,
'percentage_funded'
=>
$this
->
percentage_funded
,
'percentage_funded'
=>
$this
->
percentage_funded
,
'qrcode'
=>
[
'base64'
=>
base64_encode
(
$this
->
qrcode
)],
'qrcode'
=>
[
'base64'
=>
base64_encode
(
$this
->
qrcode
)],
...
...
app/Project.php
View file @
997acbfe
...
@@ -15,7 +15,7 @@ use SimpleSoftwareIO\QrCode\Facades\QrCode;
...
@@ -15,7 +15,7 @@ use SimpleSoftwareIO\QrCode\Facades\QrCode;
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Deposit[] $deposits
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Deposit[] $deposits
* @property-read mixed $
amount_received
* @property-read mixed $
raised_amount
* @property-read string $address_uri
* @property-read string $address_uri
* @property-read int $percentage_funded
* @property-read int $percentage_funded
* @property-read int $contributions
* @property-read int $contributions
...
@@ -51,7 +51,7 @@ class Project extends Model
...
@@ -51,7 +51,7 @@ class Project extends Model
}
}
public
function
getPercentageFundedAttribute
()
{
public
function
getPercentageFundedAttribute
()
{
return
min
(
100
,
round
(
$this
->
amount_received
/
$this
->
target_amount
*
100
));
return
min
(
100
,
round
(
$this
->
raised_amount
/
$this
->
target_amount
*
100
));
}
}
public
function
getContributionsAttribute
()
{
public
function
getContributionsAttribute
()
{
...
...
gitlab/Connection.php
View file @
997acbfe
...
@@ -18,14 +18,14 @@ class Connection
...
@@ -18,14 +18,14 @@ class Connection
$url
=
env
(
'GITLAB_URL'
)
.
'/merge_requests?scope=all&per_page=50&state='
.
$state
;
$url
=
env
(
'GITLAB_URL'
)
.
'/merge_requests?scope=all&per_page=50&state='
.
$state
;
$response
=
$this
->
client
->
request
(
'GET'
,
$url
,
[
'headers'
=>
[
'Private-Token'
=>
env
(
'GITLAB_ACCESS_TOKEN'
)]]
);
$response
=
$this
->
client
->
request
(
'GET'
,
$url
);
return
collect
(
json_decode
(
$response
->
getBody
()));
return
collect
(
json_decode
(
$response
->
getBody
()));
}
}
public
function
getNewFiles
(
$merge_request_iid
)
{
public
function
getNewFiles
(
$merge_request_iid
)
{
$url
=
env
(
'GITLAB_URL'
)
.
'/merge_requests/'
.
$merge_request_iid
.
'/changes'
;
$url
=
env
(
'GITLAB_URL'
)
.
'/merge_requests/'
.
$merge_request_iid
.
'/changes'
;
$response
=
$this
->
client
->
request
(
'GET'
,
$url
,
[
'headers'
=>
[
'Private-Token'
=>
env
(
'GITLAB_ACCESS_TOKEN'
)]]
);
$response
=
$this
->
client
->
request
(
'GET'
,
$url
);
$deserialized
=
collect
(
json_decode
(
$response
->
getBody
()));
$deserialized
=
collect
(
json_decode
(
$response
->
getBody
()));
$result
=
[];
$result
=
[];
...
@@ -39,4 +39,4 @@ class Connection
...
@@ -39,4 +39,4 @@ class Connection
}
}
}
}
\ No newline at end of file
resources/views/projects/index.blade.php
View file @
997acbfe
...
@@ -12,9 +12,9 @@
...
@@ -12,9 +12,9 @@
<tr>
<tr>
<td><a
href=
'{!! url('
/
projects
/'.$
project-
>
subaddr_index); !!}'>{{ $project->subaddr_index }}
</a></td>
<td><a
href=
'{!! url('
/
projects
/'.$
project-
>
subaddr_index); !!}'>{{ $project->subaddr_index }}
</a></td>
<td>
{{$project->status}}
</td>
<td>
{{$project->status}}
</td>
<td>
{{$project->
amount_received
}} XMR
</td>
<td>
{{$project->
raised_amount
}} XMR
</td>
<td>
{{$project->target_amount}} XMR
</td>
<td>
{{$project->target_amount}} XMR
</td>
</tr>
</tr>
@endforeach
@endforeach
</tbody>
</tbody>
</table>
</table>
\ No newline at end of file
resources/views/projects/show.blade.php
View file @
997acbfe
XMR
{{
$project
->
amount_received
}}
/
XMR
{{
$project
->
target_amount
}}
Target
XMR
{{
$project
->
raised_amount
}}
/
XMR
{{
$project
->
target_amount
}}
Target
{{
$project
->
contributions
}}
contributions
made
.
{{
$project
->
percentage_funded
}}
%
{{
$project
->
contributions
}}
contributions
made
.
{{
$project
->
percentage_funded
}}
%
<
br
>
<
br
>
<
img
src
=
"data:image/png;base64,{!! base64_encode(
$project->qrcode
) !!}"
>
<
img
src
=
"data:image/png;base64,{!! base64_encode(
$project->qrcode
) !!}"
>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment