From 4818e3f4444fe213471b2b2e314ed87bca0f7f07 Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Tue, 11 Sep 2012 10:52:27 +0800 Subject: [PATCH] first version for new member html --- app/controllers/pages_controller.rb | 3 +- app/models/user/user.rb | 1 + .../users_new_interface/_filter.html.erb | 94 ++++++++++++ .../_index_paginator.html.erb | 17 +++ .../_user_for_listing.html.erb | 37 +++++ .../_user_for_summary.html.erb | 30 ++++ .../_user_for_thumbnail.html.erb | 22 +++ .../admin/users_new_interface/index.html.erb | 18 +++ .../index_summary.html.erb | 9 ++ .../index_thumbnail.html.erb | 8 ++ .../admin/users_new_interface/show.html.erb | 135 ++++++++++++++++++ app/views/layouts/_side_bar.html.erb | 17 +++ config/locales/zh_tw.yml | 32 ++++- config/routes.rb | 1 + 14 files changed, 420 insertions(+), 4 deletions(-) create mode 100644 app/views/admin/users_new_interface/_filter.html.erb create mode 100644 app/views/admin/users_new_interface/_index_paginator.html.erb create mode 100644 app/views/admin/users_new_interface/_user_for_listing.html.erb create mode 100644 app/views/admin/users_new_interface/_user_for_summary.html.erb create mode 100644 app/views/admin/users_new_interface/_user_for_thumbnail.html.erb create mode 100644 app/views/admin/users_new_interface/index.html.erb create mode 100644 app/views/admin/users_new_interface/index_summary.html.erb create mode 100644 app/views/admin/users_new_interface/index_thumbnail.html.erb create mode 100644 app/views/admin/users_new_interface/show.html.erb diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 9890ed0e0..4c3084dd2 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -17,7 +17,8 @@ class PagesController < ApplicationController def show #begin @item = Item.first(:conditions => {:path => params[:page_name]}) - if @item && @item.is_published #&& (@item.enabled_for.nil? ? true : @item.enabled_for.include?(I18n.locale.to_s)) + #binding.pry + if @item && @item.is_published && (@item.enabled_for.nil? ? true : @item.enabled_for.include?(I18n.locale.to_s)) impressionist(@item) case @item.class.to_s when 'Page' diff --git a/app/models/user/user.rb b/app/models/user/user.rb index 34e496d8e..f2dcd2794 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -28,6 +28,7 @@ class User belongs_to :role + has_and_belongs_to_many :roles has_and_belongs_to_many :sub_roles accepts_nested_attributes_for :attribute_values, :allow_destroy => true diff --git a/app/views/admin/users_new_interface/_filter.html.erb b/app/views/admin/users_new_interface/_filter.html.erb new file mode 100644 index 000000000..92752c8f8 --- /dev/null +++ b/app/views/admin/users_new_interface/_filter.html.erb @@ -0,0 +1,94 @@ + \ No newline at end of file diff --git a/app/views/admin/users_new_interface/_index_paginator.html.erb b/app/views/admin/users_new_interface/_index_paginator.html.erb new file mode 100644 index 000000000..381ed352f --- /dev/null +++ b/app/views/admin/users_new_interface/_index_paginator.html.erb @@ -0,0 +1,17 @@ +
+ <%= link_to(new_admin_users_new_interface_path,:class=> "btn btn-primary pull-right") do%> + <%= t("admin.new_admin.action.add")%> + <% end -%> + +
diff --git a/app/views/admin/users_new_interface/_user_for_listing.html.erb b/app/views/admin/users_new_interface/_user_for_listing.html.erb new file mode 100644 index 000000000..6d4535901 --- /dev/null +++ b/app/views/admin/users_new_interface/_user_for_listing.html.erb @@ -0,0 +1,37 @@ + + + +
+
+ # TODO:Teacher + # TODO:Student + # TODO:Staff +
+
+ + + <%= user_for_listing.name %> +
+ +
+ + # TODO + # TODO + + 10,597 +

+ + \ No newline at end of file diff --git a/app/views/admin/users_new_interface/_user_for_summary.html.erb b/app/views/admin/users_new_interface/_user_for_summary.html.erb new file mode 100644 index 000000000..271271426 --- /dev/null +++ b/app/views/admin/users_new_interface/_user_for_summary.html.erb @@ -0,0 +1,30 @@ +
  • + + + + + + + +
    +
    +

    +
    +

    + <%= image_tag(user_for_summary.avatar.thumb.url) %> +
    +
    +

    + <%= user_for_summary.name%> +

    +
    + #TODO 教授兼系主任#TODO 大學部校友 +
    +
      +
    • #TODO 258Publications
    • +
    • #TODO 16Courses
    • +
    • #TODO 10,578Followers
    • +
    +
    +
    +
  • \ No newline at end of file diff --git a/app/views/admin/users_new_interface/_user_for_thumbnail.html.erb b/app/views/admin/users_new_interface/_user_for_thumbnail.html.erb new file mode 100644 index 000000000..ac3202274 --- /dev/null +++ b/app/views/admin/users_new_interface/_user_for_thumbnail.html.erb @@ -0,0 +1,22 @@ +
  • + + + + + + + +
    +
    +

    +
    +

    + <%= image_tag(user_for_thumbnail.avatar.thumb.url) %> +
    +
    +

    + <%= user_for_thumbnail.name%> +

    +
    +
    +
  • \ No newline at end of file diff --git a/app/views/admin/users_new_interface/index.html.erb b/app/views/admin/users_new_interface/index.html.erb new file mode 100644 index 000000000..2e58ab727 --- /dev/null +++ b/app/views/admin/users_new_interface/index.html.erb @@ -0,0 +1,18 @@ + <%= render :partial => "filter"%> + + + + + + + + + + + + + <%= render :partial => "user_for_listing",:collection=> [@users.first]%> + +
    + + <%= render :partial=> "index_paginator" %> diff --git a/app/views/admin/users_new_interface/index_summary.html.erb b/app/views/admin/users_new_interface/index_summary.html.erb new file mode 100644 index 000000000..ac568bfea --- /dev/null +++ b/app/views/admin/users_new_interface/index_summary.html.erb @@ -0,0 +1,9 @@ + <%= render :partial => "filter"%> +
    + +
    + <%= render :partial=> "index_paginator" %> \ No newline at end of file diff --git a/app/views/admin/users_new_interface/index_thumbnail.html.erb b/app/views/admin/users_new_interface/index_thumbnail.html.erb new file mode 100644 index 000000000..35eb6a180 --- /dev/null +++ b/app/views/admin/users_new_interface/index_thumbnail.html.erb @@ -0,0 +1,8 @@ + <%= render :partial => "filter"%> +
    +
    + <%= render :partial=> "index_paginator" %> \ No newline at end of file diff --git a/app/views/admin/users_new_interface/show.html.erb b/app/views/admin/users_new_interface/show.html.erb new file mode 100644 index 000000000..d6a830484 --- /dev/null +++ b/app/views/admin/users_new_interface/show.html.erb @@ -0,0 +1,135 @@ +
    +
    +

    + <%= image_tag(@user.avatar.url) %> +
    + +
    +
    + + +
    \ No newline at end of file diff --git a/app/views/layouts/_side_bar.html.erb b/app/views/layouts/_side_bar.html.erb index 0088787b1..d414cc6f4 100644 --- a/app/views/layouts/_side_bar.html.erb +++ b/app/views/layouts/_side_bar.html.erb @@ -36,6 +36,22 @@ <%#= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), admin_users_path %> <%# end -%> +<%= content_tag :li, :class => active_for_controllers('users_new_interface') do -%> + <%= link_to content_tag(:i, nil, :class => 'icons-page') + t('admin.new_admin.user'), admin_users_new_interface_index_path %> + <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('users_new_interface')) do -%> + <%= content_tag :li, link_to(t('admin.new_admin.side_bar.all_user'), ), :class => active_for_action('users_new_interface', 'index') %> + <%= content_tag :li, link_to("#TODO Role1", ), :class => active_for_action('users_new_interface', 'index') %> + <%= content_tag :li, link_to(t("#TODO Role2"), ), :class => active_for_action('users_new_interface', 'index') %> + <%= content_tag :li, link_to(t('admin.new_admin.side_bar.add_user')) %> + <%= content_tag :li, link_to(t('admin.new_admin.side_bar.user_roles')) %> + <%= content_tag :li, link_to(t('admin.new_admin.side_bar.user_info')) %> + <% end -%> + +<% end -%> + + + + <%= content_tag :li, :class => active_for_controllers('page_contexts') || active_for_app_auth('page_content') || active_for_ob_auths_object("PageContext") do -%> <%= link_to content_tag(:i, nil, :class => 'icons-page') + t('admin.page'), panel_page_content_back_end_page_contexts_path %> <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('page_contexts')) do -%> @@ -56,6 +72,7 @@ <% end -%> <% end %> + <%= content_tag :li, :class => active_for_controllers('web_links', '/panel/web_resource/back_end/tags', 'web_link_categorys') || active_for_app_auth('web_resource') || active_for_ob_auths_object("WebLinkCategory") do -%> <%= link_to content_tag(:i, nil, :class => 'icons-link') + t('admin.link'), panel_web_resource_back_end_web_links_path %> <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('web_links', '/panel/web_resource/back_end/tags', 'web_link_categorys')) do -%> diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index d8483ecef..81f974f57 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -210,9 +210,35 @@ zh_tw: no_home_page: 您沒有首頁 no_layout: 您沒有佈局 name: 名稱 - nccu: 政大客制 - nccu_c: - nccu_ldap_uid: NCCU LDAP 帳號 + new_admin: + side_bar: + all_user: 所有使用者 + add_user: 新增使用者 + user_roles: 角色 + user_info: 使用者資訊 + user: 會員 + action: + add: 新增 + edit: 編輯 + delete: 刪除 + quick_edit: 快速編輯 + next: 下一頁 + prev: 上一頁 + attributes: + roles: 角色 + name: 名稱 + publications: 出版數 + courses: 開課數 + followers: 被關注數 + show_mode: + index: 清單 + summary: 摘要 + thumbnail: 縮圖 + table_header: + status: 狀態 + category: 分類 + tags: 標籤 + clear_filter: 重置 new_asset: 新增資產 new_component: 新增元件 new_design: 新設計 diff --git a/config/routes.rb b/config/routes.rb index c11229098..e0416c1cc 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -127,6 +127,7 @@ Orbit::Application.routes.draw do resources :tags resources :translations resources :users + resources :users_new_interface end # end admin