Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
monero-project
CCS Backend
Commits
e125c0fa
Commit
e125c0fa
authored
Jan 27, 2019
by
xiphon
Browse files
db: rename project 'gitlab_username' to 'author', drop unused fields
parent
b9a9902e
Changes
5
Show whitespace changes
Inline
Side-by-side
app/Console/Commands/UpdateSiteProposals.php
View file @
e125c0fa
...
...
@@ -101,7 +101,7 @@ class UpdateSiteProposals extends Command
$group
=
new
stdClass
();
$group
->
stage
=
'Funding Required'
;
$responseProposals
=
[];
$proposals
=
Project
::
where
(
'
gitlab_state'
,
'merged'
)
->
where
(
'
state'
,
'FUNDING-REQUIRED'
)
->
get
();
$proposals
=
Project
::
where
(
'state'
,
'FUNDING-REQUIRED'
)
->
get
();
foreach
(
$proposals
as
$proposal
)
{
$prop
=
new
stdClass
();
$prop
->
name
=
$proposal
->
title
;
...
...
@@ -111,8 +111,8 @@ class UpdateSiteProposals extends Command
$prop
->
percentage
=
$proposal
->
percentage_funded
;
$prop
->
amount
=
$proposal
->
target_amount
;
$prop
->
{
'amount-funded'
}
=
$proposal
->
amount_received
;
$prop
->
author
=
$proposal
->
gitlab_username
;
$prop
->
date
=
$proposal
->
gitlab_
created_at
->
format
(
'F j, Y'
);
$prop
->
author
=
$proposal
->
author
;
$prop
->
date
=
$proposal
->
created_at
->
format
(
'F j, Y'
);
$responseProposals
[]
=
$prop
;
}
$group
->
proposals
=
$responseProposals
;
...
...
@@ -124,7 +124,7 @@ class UpdateSiteProposals extends Command
$group
=
new
stdClass
();
$group
->
stage
=
'Work in Progress'
;
$responseProposals
=
[];
$proposals
=
Project
::
where
(
'
gitlab_state'
,
'merged'
)
->
where
(
'
state'
,
'WORK-IN-PROGRESS'
)
->
get
();
$proposals
=
Project
::
where
(
'state'
,
'WORK-IN-PROGRESS'
)
->
get
();
foreach
(
$proposals
as
$proposal
)
{
$prop
=
new
stdClass
();
$prop
->
name
=
$proposal
->
title
;
...
...
@@ -136,8 +136,8 @@ class UpdateSiteProposals extends Command
$prop
->
percentage
=
$proposal
->
percentage_funded
;
$prop
->
amount
=
$proposal
->
target_amount
;
$prop
->
{
'amount-funded'
}
=
$proposal
->
amount_received
;
$prop
->
author
=
$proposal
->
gitlab_username
;
$prop
->
date
=
$proposal
->
gitlab_
created_at
->
format
(
'F j, Y'
);
$prop
->
author
=
$proposal
->
author
;
$prop
->
date
=
$proposal
->
created_at
->
format
(
'F j, Y'
);
$responseProposals
[]
=
$prop
;
}
$group
->
proposals
=
$responseProposals
;
...
...
app/Project.php
View file @
e125c0fa
...
...
@@ -28,7 +28,6 @@ use SimpleSoftwareIO\QrCode\Facades\QrCode;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Project whereUpdatedAt($value)
* @mixin \Eloquent
* @property string $title
* @property int|null $merge_request_id
* @property string|null $commit_sha
* @method static \Illuminate\Database\Eloquent\Builder|\App\Project whereCommitSha($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Project whereMergeRequestId($value)
...
...
@@ -38,7 +37,7 @@ class Project extends Model
{
protected
$guarded
=
[
'id'
];
protected
$dates
=
[
'gitlab_created_at'
,
'created_at'
,
'updated_at'
];
protected
$dates
=
[
'created_at'
,
'updated_at'
];
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
...
...
database/factories/ProjectFactory.php
View file @
e125c0fa
...
...
@@ -14,11 +14,8 @@ $factory->define(\App\Project::class, function (Faker $faker) {
'target_amount'
=>
$faker
->
randomFloat
(
2
,
0
,
2000
),
'raised_amount'
=>
$faker
->
randomFloat
(
2
,
0
,
2000
),
'state'
=>
$state
,
'merge_request_id'
=>
$faker
->
randomNumber
(
6
),
'gitlab_username'
=>
$faker
->
userName
,
'author'
=>
$faker
->
userName
,
'gitlab_url'
=>
$faker
->
url
,
'gitlab_state'
=>
$status
,
'gitlab_created_at'
=>
$faker
->
dateTimeThisYear
,
'created_at'
=>
$faker
->
dateTimeThisYear
,
'updated_at'
=>
$faker
->
dateTimeThisYear
,
];
...
...
database/migrations/2018_09_10_211623_create_projects_table.php
View file @
e125c0fa
...
...
@@ -15,6 +15,7 @@ class CreateProjectsTable extends Migration
{
Schema
::
create
(
'projects'
,
function
(
Blueprint
$table
)
{
$table
->
increments
(
'id'
);
$table
->
string
(
'author'
);
$table
->
string
(
'title'
);
$table
->
string
(
'payment_id'
)
->
nullable
();
$table
->
string
(
'address'
)
->
nullable
();
...
...
@@ -24,11 +25,7 @@ class CreateProjectsTable extends Migration
$table
->
string
(
'raised_amount'
)
->
nullable
();
$table
->
string
(
'state'
)
->
default
(
'OPENED'
);
$table
->
string
(
'filename'
)
->
nullable
();
$table
->
unsignedInteger
(
'merge_request_id'
)
->
unique
();
$table
->
string
(
'gitlab_username'
);
$table
->
string
(
'gitlab_url'
);
$table
->
string
(
'gitlab_state'
)
->
default
(
'opened'
);
$table
->
timestamp
(
'gitlab_created_at'
);
$table
->
timestamps
();
});
}
...
...
resources/views/projects/donate.blade.php
View file @
e125c0fa
...
...
@@ -104,7 +104,7 @@
<div
class=
"col-xs-12"
>
<h2>
{{$project->title}}
</h2>
<div
class=
"row middle-xs between-xs"
>
<p
class=
"author-list"
><span><img
src=
"/img/author-filled.png"
></span>
{{$project->
gitlab_username
}}
</p>
<p
class=
"author-list"
><span><img
src=
"/img/author-filled.png"
></span>
{{$project->
author
}}
</p>
<p
class=
"date-list"
><span><img
src=
"/img/calendar.png"
></span>
{{$project->github_created_at}}
</p>
<p
class=
"bar-fund-status"
>
Raised
<span
class=
"progress-number-funded"
>
{{$project->raised_amount}}
</span>
of
<span
class=
"progress-number-goal"
>
{{$project->target_amount}}
</span>
XMR
</p>
</div>
...
...
Write
Preview
Supports
Markdown
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