| |
@@ -0,0 +1,31 @@
|
| |
+ import flask
|
| |
+ from coprs import models
|
| |
+ from coprs.logic.stat_logic import CounterStatLogic
|
| |
+ from coprs.logic.coprs_logic import CoprScoreLogic, CoprsLogic
|
| |
+ from coprs.logic.builds_logic import BuildsLogic
|
| |
+ from coprs.logic.complex_logic import ComplexLogic
|
| |
+
|
| |
+
|
| |
+ explore_ns = flask.Blueprint("explore_ns", __name__, url_prefix="/explore")
|
| |
+
|
| |
+
|
| |
+ @explore_ns.route("/")
|
| |
+ def explore_home():
|
| |
+ stats_projects = CounterStatLogic.get_popular_projects()
|
| |
+ stats_chroots = CounterStatLogic.get_popular_chroots()
|
| |
+
|
| |
+ upvoted_projects_ids = [x.copr_id for x in
|
| |
+ CoprScoreLogic.get_popular_projects()]
|
| |
+ upvoted_projects = (CoprsLogic.get_multiple()
|
| |
+ .filter(models.Copr.id.in_(upvoted_projects_ids)))
|
| |
+
|
| |
+ return flask.render_template(
|
| |
+ "explore.html",
|
| |
+ stats_projects=stats_projects,
|
| |
+ stats_chroots=stats_chroots,
|
| |
+ upvoted_projects=upvoted_projects,
|
| |
+
|
| |
+ # Meh this should be done automatically
|
| |
+ tasks_info=ComplexLogic.get_queue_sizes(),
|
| |
+ graph=BuildsLogic.get_small_graph_data('30min'),
|
| |
+ )
|
| |
See #1890
(Popular projects)
See #1919
(Editor's choice tags)
For the long time we have been discussing a page where users could
discover interesting projects (whatever that means). Maybe most
downloaded projects, most upvoted projects, manually picked projects
featured as interesting, projects that has been picked for Fedora
Magazine article, etc.
It is quite a lot of work and nobody will probably have enough time
to implement it all at once. So I am starting the implementation, and
leaving it unfinished, so we can continue to work on it next time.
I wasn't sure what terminology to use, "Explore Projects", "Discover
Projects", or simply "Popular projects", feel free to change as we go
on.