Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project pages #117

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ all: build

build:
cd src && $(MAKE)
cp src/search.js ext/js/

install:
cd src && $(MAKE) install
Expand Down
1 change: 0 additions & 1 deletion ext/js/search.js

This file was deleted.

7 changes: 7 additions & 0 deletions src/o2wMisc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,10 @@ let string_of_timestamp ?(short = false) time =
Printf.sprintf "%s %d" month_str tm.tm_mday
else
Printf.sprintf "%s %d, %d" month_str tm.tm_mday year

let ident_of_timestamp time =
let tm = Unix.gmtime time in
let open Unix in
let month_str = string_of_month tm.tm_mon in
let year = 1900 + tm.tm_year in
Printf.sprintf "%d%s%d" year month_str tm.tm_mday
3 changes: 3 additions & 0 deletions src/o2wMisc.mli
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ val string_of_month: int -> string

(** Return the string representation of a timestamp *)
val string_of_timestamp: ?short:bool -> float -> string

(** Return a fragment identifier for a timestamp *)
val ident_of_timestamp: float -> string
17 changes: 8 additions & 9 deletions src/o2wPackage.ml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ let to_html ~statistics universe pkg_info =
let pkg_homepage = links "Homepage" (OpamFile.OPAM.homepage pkg_opam) in
let pkg_issues = links "Issue Tracker" (OpamFile.OPAM.bug_reports pkg_opam) in
let pkg_tags = list "Tag" (OpamFile.OPAM.tags pkg_opam) in
let pkg_published = O2wMisc.string_of_timestamp pkg_info.published in
let pkg_published = match pkg_info.published with
| None -> None
| Some timestamp ->
Some ("Published",<:html<$str:O2wMisc.string_of_timestamp timestamp$>>)
in
let html_conj = <:html<&amp;>> in
let html_disj = <:html<|>> in
let vset_of_name name =
Expand Down Expand Up @@ -354,7 +358,7 @@ let to_html ~statistics universe pkg_info =
>>))
in
<:html<
<h2>$str: pkg_info.name$</h2>
<h2><a href="../">$str: pkg_info.name$</a> $str: pkg_info.version$</h2>

<div class="row">
<div class="span9">
Expand All @@ -370,18 +374,13 @@ let to_html ~statistics universe pkg_info =
$mk_tr pkg_license$
$mk_tr pkg_homepage$
$mk_tr pkg_issues$
$mk_tr pkg_tags$
$mk_tr pkg_maintainer$
$mk_tr pkg_tags$
$mk_tr pkg_depends$
$mk_tr pkg_depopts$
$mk_tr pkg_compiler$
$mk_tr pkg_os$
<tr>
<th>Published</th>
<td>
$str: pkg_published$
</td>
</tr>
$mk_tr pkg_published$
$pkg_url$
$pkg_stats$
$pkg_edit$
Expand Down
Loading