diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-07-23 13:03:49 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-07-23 13:03:49 +0400 |
commit | 367445fdcde4d07a685610449a2ab4d43b1fc507 (patch) | |
tree | 5d720c3c76c02fe8539e5bdaca64f76a5549a043 /app/views/explore | |
parent | 1df0345e9e642ca7e9d73c12430921b0fe62d25e (diff) |
Refactor explore area
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/views/explore')
-rw-r--r-- | app/views/explore/groups/index.html.haml | 51 | ||||
-rw-r--r-- | app/views/explore/projects/_project.html.haml | 20 | ||||
-rw-r--r-- | app/views/explore/projects/index.html.haml | 38 | ||||
-rw-r--r-- | app/views/explore/projects/trending.html.haml | 11 |
4 files changed, 120 insertions, 0 deletions
diff --git a/app/views/explore/groups/index.html.haml b/app/views/explore/groups/index.html.haml new file mode 100644 index 00000000000..80ddd5c1bde --- /dev/null +++ b/app/views/explore/groups/index.html.haml @@ -0,0 +1,51 @@ +.clearfix + .pull-left + = form_tag explore_groups_path, method: :get, class: 'form-inline form-tiny' do |f| + .form-group + = search_field_tag :search, params[:search], placeholder: "Filter by name", class: "form-control search-text-input input-mn-300", id: "groups_search" + .form-group + = submit_tag 'Search', class: "btn btn-primary wide" + + .pull-right + .dropdown.inline + %a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"} + %span.light sort: + - if @sort.present? + = @sort.humanize + - else + Name + %b.caret + %ul.dropdown-menu + %li + = link_to explore_groups_path(sort: nil) do + Name + = link_to explore_groups_path(sort: 'newest') do + Newest + = link_to explore_groups_path(sort: 'oldest') do + Oldest + = link_to explore_groups_path(sort: 'recently_updated') do + Recently updated + = link_to explore_groups_path(sort: 'last_updated') do + Last updated + +%hr + +%ul.bordered-list + - @groups.each do |group| + %li + .clearfix + %h4 + = link_to group_path(id: group.path) do + %i.icon-group + = group.name + .clearfix + %p + = truncate group.description, length: 150 + .clearfix + %p.light + #{pluralize(group.members.size, 'member')}, #{pluralize(group.projects.count, 'project')} + - unless @groups.present? + .nothing-here-block No public groups + + += paginate @groups, theme: "gitlab" diff --git a/app/views/explore/projects/_project.html.haml b/app/views/explore/projects/_project.html.haml new file mode 100644 index 00000000000..665d111bead --- /dev/null +++ b/app/views/explore/projects/_project.html.haml @@ -0,0 +1,20 @@ +%li + %h4.project-title + .project-access-icon + = visibility_level_icon(project.visibility_level) + = link_to project.name_with_namespace, project + + - if project.description.present? + %p.project-description.str-truncated + = project.description + + .repo-info + - unless project.empty_repo? + = link_to pluralize(project.repository.round_commit_count, 'commit'), project_commits_path(project, project.default_branch) + · + = link_to pluralize(project.repository.branch_names.count, 'branch'), project_branches_path(project) + · + = link_to pluralize(project.repository.tag_names.count, 'tag'), project_tags_path(project) + - else + %i.icon-warning-sign + Empty repository diff --git a/app/views/explore/projects/index.html.haml b/app/views/explore/projects/index.html.haml new file mode 100644 index 00000000000..32796c8b2b8 --- /dev/null +++ b/app/views/explore/projects/index.html.haml @@ -0,0 +1,38 @@ +.clearfix + .pull-left + = form_tag public_projects_path, method: :get, class: 'form-inline form-tiny' do |f| + .form-group + = search_field_tag :search, params[:search], placeholder: "Filter by name", class: "form-control search-text-input input-mn-300", id: "projects_search" + .form-group + = submit_tag 'Search', class: "btn btn-primary wide" + + .pull-right + .dropdown.inline + %a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"} + %span.light sort: + - if @sort.present? + = @sort.humanize + - else + Name + %b.caret + %ul.dropdown-menu + %li + = link_to public_projects_path(sort: nil) do + Name + = link_to public_projects_path(sort: 'newest') do + Newest + = link_to public_projects_path(sort: 'oldest') do + Oldest + = link_to public_projects_path(sort: 'recently_updated') do + Recently updated + = link_to public_projects_path(sort: 'last_updated') do + Last updated + +%hr +.public-projects + %ul.bordered-list.top-list + = render @projects + - unless @projects.present? + .nothing-here-block No public projects + + = paginate @projects, theme: "gitlab" diff --git a/app/views/explore/projects/trending.html.haml b/app/views/explore/projects/trending.html.haml new file mode 100644 index 00000000000..5b28273d5dd --- /dev/null +++ b/app/views/explore/projects/trending.html.haml @@ -0,0 +1,11 @@ +.explore-trending-block + %p.lead + %i.icon-comments-alt + See most discussed projects for last month + %hr + .public-projects + %ul.bordered-list + = render @trending_projects + + .center + = link_to 'Show all projects', public_projects_path, class: 'btn btn-primary' |