Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Admin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osuny
Admin
Commits
864b1757
Unverified
Commit
864b1757
authored
3 years ago
by
Sébastien Gaya
Browse files
Options
Downloads
Patches
Plain Diff
wip website clean
parent
42b518bd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/models/communication/website/with_publishable_objects.rb
+2
-29
2 additions, 29 deletions
app/models/communication/website/with_publishable_objects.rb
app/models/research/journal/article.rb
+1
-4
1 addition, 4 deletions
app/models/research/journal/article.rb
with
3 additions
and
33 deletions
app/models/communication/website/with_publishable_objects.rb
+
2
−
29
View file @
864b1757
...
...
@@ -5,25 +5,10 @@ module Communication::Website::WithPublishableObjects
def
publish_about_object
# TODO: Handle Research::Journal then use the commented version.
#
publish_object(about)
unless about.nil?
publish_object
(
about
)
if
about
.
is_a?
(
Education
::
School
)
#
about.force_publish!
unless about.nil?
about
.
force_publish!
if
about
.
is_a?
(
Education
::
School
)
end
def
publish_object
(
object
)
# "object" can be an Education::Program, ...
return
unless
github
.
valid?
object_model_name
=
object
.
class
.
name
.
demodulize
if
object
.
respond_to?
(
:github_path
)
github_path
=
object
.
github_path
else
root_folder
=
"_
#{
object_model_name
.
pluralize
.
underscore
}
"
github_path
=
"
#{
root_folder
}
/
#{
object
.
id
}
.md"
end
github_commit_message
=
"[
#{
object_model_name
}
] Save
#{
object
.
to_s
}
"
github
.
publish
(
path:
github_path
,
commit:
github_commit_message
,
data:
object
.
to_jekyll
)
end
handle_asynchronously
:publish_object
,
queue:
'default'
def
publish_blob
(
blob
)
return
unless
github
.
valid?
blob
.
analyze
unless
blob
.
analyzed?
...
...
@@ -38,18 +23,6 @@ module Communication::Website::WithPublishableObjects
end
handle_asynchronously
:publish_blob
,
queue:
'default'
def
remove_object
(
object
)
return
unless
github
.
valid?
if
object
.
respond_to?
(
:github_path
)
github_path
=
object
.
github_path
else
root_folder
=
"_
#{
object_model_name
.
pluralize
.
underscore
}
"
github_path
=
"
#{
root_folder
}
/
#{
object
.
id
}
.md"
end
github_commit_message
=
"[
#{
object_model_name
}
] Remove
#{
object
.
to_s
}
"
github
.
remove
(
github_path
,
github_commit_message
)
end
def
remove_blob
(
blob
)
return
unless
github
.
valid?
github_path
=
"_data/media/
#{
blob
.
id
[
0
..
1
]
}
/
#{
blob
.
id
}
.yml"
...
...
This diff is collapsed.
Click to expand it.
app/models/research/journal/article.rb
+
1
−
4
View file @
864b1757
...
...
@@ -63,9 +63,6 @@ class Research::Journal::Article < ApplicationRecord
private
def
update_researchers
return
unless
websites
.
any?
researchers
.
each
do
|
researcher
|
websites
.
each
{
|
website
|
website
.
publish_object
(
researcher
)
}
end
researchers
.
each
(
&
:force_publish!
)
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment