#369: updated UI for maintainers

This commit is contained in:
Vokhmin Alexey V 2014-10-27 23:56:52 +03:00
parent 3b2ebcd3f3
commit 35c6dfd21b
8 changed files with 61 additions and 41 deletions

View File

@ -1,12 +1,15 @@
class Platforms::MaintainersController < ApplicationController
layout 'bootstrap'
before_filter :authenticate_user!
skip_before_filter :authenticate_user!, only: [:index] if APP_CONFIG['anonymous_access']
load_and_authorize_resource :platform
def index
@maintainers = BuildList::Package.includes(:project)
.actual.by_platform(@platform)
.like_name(params[:q])
.paginate(page: params[:page])
@maintainer = BuildList::Package.new(params[:build_list_package])
@maintainers = BuildList::Package.includes(:project).
actual.by_platform(@platform).
like_name(@maintainer.name).
paginate(page: params[:page])
end
end

View File

@ -1,26 +0,0 @@
%table#myTable.tablesorter.platform-maintainers.static-search{cellspacing: "0", cellpadding: "0"}
%thead
%tr
%th.centered= t("activerecord.attributes.maintainer.package_name")
%th.centered= t("activerecord.attributes.maintainer.package_type")
%th.centered= t("activerecord.attributes.maintainer.version")
%th.centered{colspan: 2}= t("activerecord.models.maintainer")
%th.centered= t("activerecord.attributes.maintainer.updated_at")
%tr.search
-# TODO: change filter to Backbone.js
%th{colspan: 6, rowspan: 1}
= form_tag platform_maintainers_path(@platform), method: :get do |f|
= text_field_tag('q', params[:q], placeholder: t("layout.maintainers.search_by_package"), class: params[:q].present? ? 'black' : 'gray')
%input{type: 'submit', value: t("layout.search.header")}
= submit_tag t('layout.search.header'), data: {'disable-with' => t('layout.processing')}
= button_to t('layout.clear'), {action: :index} , method: :get
%tbody
- MaintainerPresenter.present_collection(@maintainers) do |pr|
%tr{class: cycle("odd", "even")}
%td= pr.package_link
%td= pr.package_type
%td= pr.package_version_release
%td= pr.maintainer_link
%td= pr.maintainer_email_link.html_safe
%td= pr.package_updated_at

View File

@ -0,0 +1,32 @@
table.table.table-striped
thead
tr
th.text-center= t("activerecord.attributes.maintainer.package_name")
th.text-center= t("activerecord.attributes.maintainer.package_type")
th.text-center= t("activerecord.attributes.maintainer.version")
th.text-center colspan=2
= t("activerecord.models.maintainer")
th.text-center= t("activerecord.attributes.maintainer.updated_at")
tr
/ TODO: change filter to AngularJS
th colspan=6 rowspan=1
= simple_form_for @maintainer, url: platform_maintainers_path(@platform), method: :get do |f|
fieldset
= f.input :name
.button_block
= submit_tag t('layout.search.header'), data: {'disable-with' => t('layout.processing')}, class: 'btn btn-sm btn-primary'
| &nbsp;
= t('layout.or')
| &nbsp;
a href=platform_maintainers_path(@platform)
= t('layout.clear')
tbody
- MaintainerPresenter.present_collection(@maintainers) do |pr|
tr
td= pr.package_link
td= pr.package_type
td= pr.package_version_release
td= pr.maintainer_link
td= pr.maintainer_email_link.html_safe
td= pr.package_updated_at

View File

@ -1,7 +0,0 @@
-set_meta_tags title: [title_object(@platform), t('layout.maintainers.list_header')]
-# FIXME: no these 'base' links!
= render 'platforms/base/submenu'
= render 'platforms/base/sidebar'
= render partial: 'list', object: @maintainers
= will_paginate @maintainers

View File

@ -0,0 +1,8 @@
- set_meta_tags title: [title_object(@platform), t('layout.maintainers.list_header')]
/ FIXME: no these 'base' links!
= render 'platforms/base/submenu'
.container
.row
= render partial: 'list', object: @maintainers
= will_paginate @maintainers

View File

@ -2,7 +2,6 @@ en:
layout:
maintainers:
list_header: Maintainers
search_by_package: Search by package name
flash:
maintainer:
@ -23,3 +22,10 @@ en:
updated_at: Last Update
version: Version-Release
simple_form:
labels:
build_list_package:
name: Package
placeholders:
build_list_package:
name: Enter the package name here.

View File

@ -2,7 +2,6 @@ ru:
layout:
maintainers:
list_header: Майнтейнеры
search_by_package: Искать по имени пакета
flash:
maintainer:
@ -23,3 +22,10 @@ ru:
updated_at: Обновлен
version: Версия-Релиз
simple_form:
labels:
build_list_package:
name: Пакет
placeholders:
build_list_package:
name: Введите имя пакета здесь.

View File

@ -104,5 +104,3 @@ en:
platform:
term: Enter the name of file or folder here.