Merge branch 'master' into allow-no-nickname
Conflicts: app/views/home/ordergroup.html.haml app/views/login/new_password.html.haml app/views/shared/_auto_complete_users.rhtml app/views/shared/memberships/_current_members.rhtml app/views/shared/memberships/_non_members.rhtml
This commit is contained in:
commit
66ac3be81f
63 changed files with 428 additions and 438 deletions
|
|
@ -65,7 +65,7 @@ class GroupOrdersController < ApplicationController
|
|||
private
|
||||
|
||||
# Returns true if @current_user is member of an Ordergroup.
|
||||
# Used as a :before_filter by OrderingController.
|
||||
# Used as a :before_filter by OrdersController.
|
||||
def ensure_ordergroup_member
|
||||
@ordergroup = @current_user.ordergroup
|
||||
if @ordergroup.nil?
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
class MembershipsController < ApplicationController
|
||||
before_filter :authenticate_membership_or_admin
|
||||
|
||||
def add_member
|
||||
user = User.find(params[:user_id])
|
||||
Membership.create(:group => @group, :user => user)
|
||||
redirect_to :action => 'reload', :id => @group
|
||||
end
|
||||
|
||||
def drop_member
|
||||
begin
|
||||
Membership.find(params[:membership_id]).destroy
|
||||
if User.find(@current_user.id).role_admin?
|
||||
redirect_to :action => 'reload', :id => @group
|
||||
else
|
||||
# If the user drops himself from admin group
|
||||
flash[:notice] = MESG_NO_ADMIN_ANYMORE
|
||||
render(:update) {|page| page.redirect_to :controller => "index"}
|
||||
end
|
||||
rescue => error
|
||||
flash[:error] = error.to_s
|
||||
redirect_to :action => 'reload', :id => @group
|
||||
end
|
||||
end
|
||||
|
||||
def reload
|
||||
render :update do |page|
|
||||
page.replace_html 'members', :partial => 'shared/memberships/current_members', :object => @group
|
||||
page.replace_html 'non_members', :partial => 'shared/memberships/non_members', :object => @group
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -48,6 +48,9 @@ class OrdersController < ApplicationController
|
|||
end
|
||||
send_data pdf.to_pdf, filename: pdf.filename, type: 'application/pdf'
|
||||
end
|
||||
format.text do
|
||||
send_data text_fax_template, filename: @order.name+'.txt', type: 'text/plain'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -101,12 +104,14 @@ class OrdersController < ApplicationController
|
|||
rescue => error
|
||||
redirect_to orders_url, alert: I18n.t('errors.general_msg', :msg => error.message)
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
# Renders the fax-text-file
|
||||
# e.g. for easier use with online-fax-software, which don't accept pdf-files
|
||||
# TODO move to text template
|
||||
def text_fax_template
|
||||
order = Order.find(params[:id])
|
||||
supplier = order.supplier
|
||||
supplier = @order.supplier
|
||||
contact = FoodsoftConfig[:contact].symbolize_keys
|
||||
text = I18n.t('orders.fax.heading', :name => FoodsoftConfig[:name])
|
||||
text += "\n#{Supplier.human_attribute_name(:customer_number)}: #{supplier.customer_number}" unless supplier.customer_number.blank?
|
||||
|
|
@ -117,15 +122,13 @@ class OrdersController < ApplicationController
|
|||
text += "****** " + I18n.t('orders.fax.articles') + "\n\n"
|
||||
text += I18n.t('orders.fax.number') + " " + I18n.t('orders.fax.amount') + " " + I18n.t('orders.fax.name') + "\n"
|
||||
# now display all ordered articles
|
||||
order.order_articles.ordered.all(:include => [:article, :article_price]).each do |oa|
|
||||
@order.order_articles.ordered.all(:include => [:article, :article_price]).each do |oa|
|
||||
number = oa.article.order_number
|
||||
(8 - number.size).times { number += " " }
|
||||
quantity = oa.units_to_order.to_i.to_s
|
||||
quantity = " " + quantity if quantity.size < 2
|
||||
text += "#{number} #{quantity} #{oa.article.name}\n"
|
||||
end
|
||||
send_data text,
|
||||
:type => 'text/plain; charset=utf-8; header=present',
|
||||
:disposition => "attachment; filename=#{order.name}"
|
||||
text
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,130 +0,0 @@
|
|||
# encoding: utf-8
|
||||
class PagesController < ApplicationController
|
||||
|
||||
def index
|
||||
@page = Page.find_by_permalink "Home"
|
||||
|
||||
if @page
|
||||
render :action => 'show'
|
||||
else
|
||||
redirect_to all_pages_path
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
if params[:permalink]
|
||||
@page = Page.find_by_permalink(params[:permalink])
|
||||
elsif params[:id]
|
||||
page = Page.find_by_id(params[:id])
|
||||
if page.nil?
|
||||
flash[:error] = I18n.t('pages.cshow.error_noexist')
|
||||
redirect_to all_pages_path and return
|
||||
else
|
||||
redirect_to wiki_page_path(page.permalink) and return
|
||||
end
|
||||
end
|
||||
|
||||
if @page.nil?
|
||||
redirect_to new_page_path(:title => params[:permalink])
|
||||
elsif @page.redirect?
|
||||
page = Page.find_by_id(@page.redirect)
|
||||
unless page.nil?
|
||||
flash[:notice] = I18n.t('pages.cshow.redirect_notice', :page => @page.title)
|
||||
redirect_to wiki_page_path(page.permalink)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@page = Page.new
|
||||
@page.title = params[:title].gsub("_", " ") if params[:title]
|
||||
@page.parent = Page.find_by_permalink(params[:parent]) if params[:parent]
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.xml { render :xml => @page }
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
@page = Page.find(params[:id])
|
||||
end
|
||||
|
||||
def create
|
||||
@page = current_user.pages.build(params[:page])
|
||||
|
||||
if params[:preview]
|
||||
render :action => 'new'
|
||||
else
|
||||
if @page.save
|
||||
flash[:notice] = I18n.t('pages.create.notice')
|
||||
redirect_to(wiki_page_path(@page.permalink))
|
||||
else
|
||||
render :action => "new"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
@page = Page.find(params[:id])
|
||||
@page.attributes = params[:page].merge({:user => current_user})
|
||||
|
||||
if params[:preview]
|
||||
@page.attributes = params[:page]
|
||||
render :action => 'edit'
|
||||
else
|
||||
if @page.save
|
||||
@page.parent_id = parent_id if (!params[:parent_id].blank? \
|
||||
and params[:parent_id] != @page_id)
|
||||
flash[:notice] = I18n.t('pages.update.notice')
|
||||
redirect_to wiki_page_path(@page.permalink)
|
||||
else
|
||||
render :action => "edit"
|
||||
end
|
||||
end
|
||||
|
||||
rescue ActiveRecord::StaleObjectError
|
||||
flash[:error] = I18n.t('pages.error_stale_object')
|
||||
redirect_to wiki_page_path(@page.permalink)
|
||||
end
|
||||
|
||||
def destroy
|
||||
@page = Page.find(params[:id])
|
||||
@page.destroy
|
||||
|
||||
flash[:notice] = I18n.t('pages.destroy.notice', :page => @page.title)
|
||||
redirect_to wiki_path
|
||||
end
|
||||
|
||||
def all
|
||||
@pages = Page.non_redirected
|
||||
@partial = params[:view] || 'recent_changes'
|
||||
|
||||
if params[:name]
|
||||
@pages = @pages.where("title LIKE ?", "%#{params[:name]}%").limit(20).order('updated_at DESC')
|
||||
@partial = 'title_list'
|
||||
else
|
||||
order = case @partial
|
||||
when 'recent_changes' then
|
||||
'updated_at DESC'
|
||||
when 'site_map' then
|
||||
'created_at DESC'
|
||||
when 'title_list' then
|
||||
'title DESC'
|
||||
end
|
||||
@pages.order(order)
|
||||
end
|
||||
end
|
||||
|
||||
def version
|
||||
@page = Page.find(params[:id])
|
||||
@version = Page::Version.find_by_page_id_and_lock_version params[:id], params[:version]
|
||||
end
|
||||
|
||||
def revert
|
||||
@page = Page.find(params[:id])
|
||||
@page.revert_to!(params[:version].to_i)
|
||||
|
||||
redirect_to wiki_page_path(@page.permalink)
|
||||
end
|
||||
end
|
||||
|
|
@ -78,14 +78,14 @@ module ApplicationHelper
|
|||
# When the 'short' option is true, abbreviations will be used:
|
||||
# When there is a non-empty model attribute 'foo', it looks for
|
||||
# the model attribute translation 'foo_short' and use that as
|
||||
# heading, with an acronym title of 'foo'.
|
||||
# heading, with an abbreviation title of 'foo'.
|
||||
# Other options are passed through to I18n.
|
||||
def heading_helper(model, attribute, options = {})
|
||||
i18nopts = options.select {|a| !['short'].include?(a) }
|
||||
s = model.human_attribute_name(attribute, i18nopts)
|
||||
if options[:short]
|
||||
sshort = model.human_attribute_name("#{attribute}_short".to_sym, options.merge({defaults: ''}))
|
||||
s = raw "<acronym title='#{s}'>#{sshort}</acronym>" unless sshort.empty?
|
||||
s = raw "<abbr title='#{s}'>#{sshort}</abbr>" unless sshort.empty?
|
||||
end
|
||||
s
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,59 +0,0 @@
|
|||
module PagesHelper
|
||||
include WikiCloth
|
||||
|
||||
def wikified_body(body, title = nil)
|
||||
WikiCloth.new({:data => body+"\n", :link_handler => Wikilink.new, :params => {:referer => title}}).to_html.html_safe
|
||||
end
|
||||
|
||||
def link_to_wikipage(page, text = nil)
|
||||
if text == nil
|
||||
link_to page.title, wiki_page_path(:permalink => page.permalink)
|
||||
else
|
||||
link_to text, wiki_page_path(:permalink => page.permalink)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def link_to_wikipage_by_permalink(permalink, text = nil)
|
||||
unless permalink.blank?
|
||||
page = Page.find_by_permalink(permalink)
|
||||
if page.nil?
|
||||
if text.nil?
|
||||
link_to permalink, new_page_path(:title => permalink)
|
||||
else
|
||||
link_to text, new_page_path(:title => permalink)
|
||||
end
|
||||
else
|
||||
link_to_wikipage(page, text)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def generate_toc(body)
|
||||
toc = String.new
|
||||
body.gsub(/^([=]{1,6})\s*(.*?)\s*(\1)/) do
|
||||
number = $1.length - 1
|
||||
name = $2
|
||||
|
||||
toc << "*" * number + " #{name}\n"
|
||||
end
|
||||
logger.debug toc.inspect
|
||||
unless toc.blank?
|
||||
toc = WikiCloth.new({:data => toc, :link_handler => Wikilink.new}).to_html
|
||||
|
||||
toc.gsub(/<li>([^<>\n]*)/) do
|
||||
name = $1
|
||||
anchor = name.gsub(/\s/, '_').gsub(/[^a-zA-Z_]/, '')
|
||||
"<li><a href='##{anchor}'>#{name.truncate(20)}</a>"
|
||||
end.html_safe
|
||||
end
|
||||
end
|
||||
|
||||
def parent_pages_to_select(current_page)
|
||||
unless current_page.homepage? # Homepage is the page trees root!
|
||||
Page.non_redirected.reject { |p| p == current_page or p.ancestors.include?(current_page) }
|
||||
else
|
||||
Array.new
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -106,7 +106,7 @@ class Article < ActiveRecord::Base
|
|||
|
||||
# to get the correspondent shared article
|
||||
def shared_article
|
||||
@shared_article ||= self.supplier.shared_supplier.shared_articles.find_by_number(self.order_number)
|
||||
@shared_article ||= self.supplier.shared_supplier.shared_articles.find_by_number(self.order_number) rescue nil
|
||||
end
|
||||
|
||||
# convert units in foodcoop-size
|
||||
|
|
|
|||
|
|
@ -90,7 +90,8 @@ class OrderArticle < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def ordered_quantities_equal_to_group_orders?
|
||||
(units_to_order * price.unit_quantity) == group_orders_sum[:quantity]
|
||||
# the rescue is a workaround for units_to_order not being defined in integration tests
|
||||
(units_to_order * price.unit_quantity) == group_orders_sum[:quantity] rescue false
|
||||
end
|
||||
|
||||
# Updates order_article and belongings during balancing process
|
||||
|
|
|
|||
|
|
@ -1,56 +0,0 @@
|
|||
class Page < ActiveRecord::Base
|
||||
include ActsAsTree
|
||||
|
||||
belongs_to :user, :foreign_key => 'updated_by'
|
||||
|
||||
acts_as_versioned version_column: :lock_version, limit: 20
|
||||
self.non_versioned_columns += %w(permalink created_at title)
|
||||
|
||||
acts_as_tree :order => "title"
|
||||
|
||||
attr_accessor :old_title # Save title to create redirect page when editing title
|
||||
|
||||
validates_presence_of :title, :body
|
||||
validates_uniqueness_of :permalink, :title
|
||||
|
||||
before_validation :set_permalink, :on => :create
|
||||
before_validation :update_permalink, :on => :update
|
||||
after_update :create_redirect
|
||||
|
||||
scope :non_redirected, :conditions => {:redirect => nil}
|
||||
scope :no_parent, :conditions => {:parent_id => nil}
|
||||
|
||||
def self.permalink(title)
|
||||
title.gsub(/[\/\.,;@\s]/, "_").gsub(/[\"\']/, "")
|
||||
end
|
||||
|
||||
def homepage?
|
||||
permalink == "Home"
|
||||
end
|
||||
|
||||
def set_permalink
|
||||
unless title.blank?
|
||||
self.permalink = Page.count == 0 ? "Home" : Page.permalink(title)
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def update_permalink
|
||||
if changed.include?("title")
|
||||
set_permalink
|
||||
self.old_title = changes["title"].first # Save title for creating redirect
|
||||
end
|
||||
end
|
||||
|
||||
def create_redirect
|
||||
unless old_title.blank?
|
||||
Page.create :redirect => id,
|
||||
:title => old_title,
|
||||
:body => I18n.t('model.page.redirect', :title => title),
|
||||
:permalink => Page.permalink(old_title),
|
||||
:updated_by => updated_by
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -17,7 +17,6 @@ class User < ActiveRecord::Base
|
|||
has_many :assignments, :dependent => :destroy
|
||||
has_many :tasks, :through => :assignments
|
||||
has_many :send_messages, :class_name => "Message", :foreign_key => "sender_id"
|
||||
has_many :pages, :foreign_key => 'updated_by'
|
||||
has_many :created_orders, :class_name => 'Order', :foreign_key => 'created_by_user_id', :dependent => :nullify
|
||||
|
||||
attr_accessor :password, :settings_attributes
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
%tr.edit_inline{:id=> "edit_"+@article.id.to_s}
|
||||
%td{:colspan=>"10"}
|
||||
= t('.note', article: h(@article.name), drop_link: link_to(t('.drop'), :controller => 'orders', :action => 'edit', :id => @order)).html_safe
|
||||
= t('.note', article: h(@article.name), drop_link: link_to(t('.drop'), edit_order_path(@order))).html_safe
|
||||
|
|
|
|||
|
|
@ -9,7 +9,14 @@
|
|||
// create List for search-feature (using list.js, http://listjs.com)
|
||||
var listjsResetPlugin = ['reset', {highlightClass: 'btn-primary'}];
|
||||
var listjsDelayPlugin = ['delay', {delayedSearchTime: 500}];
|
||||
new List(document.body, { valueNames: ['name'], engine: 'unlist', plugins: [listjsResetPlugin, listjsDelayPlugin] });
|
||||
new List(document.body, {
|
||||
valueNames: ['name'],
|
||||
engine: 'unlist',
|
||||
plugins: [listjsResetPlugin, listjsDelayPlugin],
|
||||
// make large pages work too (as we don't have paging - articles may disappear!)
|
||||
page: 10000,
|
||||
indexAsync: true
|
||||
});
|
||||
});
|
||||
|
||||
- title t('.title'), false
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
%li.nav-header= t '.foodcoop'
|
||||
%li= link_to t('.members'), foodcoop_users_path
|
||||
%li= link_to t('.tasks'), user_tasks_path
|
||||
%li= link_to t('.write_message'), :controller => "messages", :action => "new"
|
||||
%li= link_to t('.write_message'), new_message_path
|
||||
|
||||
- has_ordergroup = !@current_user.ordergroup.nil?
|
||||
- has_orders_role = @current_user.role_orders?
|
||||
|
|
|
|||
|
|
@ -4,16 +4,14 @@
|
|||
.span4
|
||||
%h2= @ordergroup.name
|
||||
.well
|
||||
- unless @ordergroup.description.blank?
|
||||
%p= @ordergroup.description
|
||||
%p
|
||||
%b= t '.description'
|
||||
= @ordergroup.description
|
||||
%p
|
||||
%b= t '.funds'
|
||||
%b= Ordergroup.human_attribute_name(:available_funds) + ':'
|
||||
= number_to_currency(@ordergroup.get_available_funds())
|
||||
%h2= t '.people'
|
||||
%ul
|
||||
- for membership in @ordergroup.memberships
|
||||
%li= show_user membership.user
|
||||
%p
|
||||
%b= Ordergroup.human_attribute_name(:user_tokens) + ':'
|
||||
= @ordergroup.memberships.map{|m| show_user m.user}.join(', ')
|
||||
= link_to t('.invite'), new_invite_path(:id => @ordergroup), :remote => true, class: 'btn btn-primary'
|
||||
.span8
|
||||
%h2= t('.account_summary')
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
%h3
|
||||
= h(t('.user.title', user: show_user))
|
||||
%small= t '.user.since', when: distance_of_time_in_words(Time.now, @current_user.created_on)
|
||||
= simple_form_for(@current_user, :url => { :action => 'update_profile'}) do |f|
|
||||
= simple_form_for(@current_user, :url => update_profile_path) do |f|
|
||||
= render :partial => 'shared/user_form_fields', :locals => {:f => f}
|
||||
.form-actions
|
||||
= submit_tag t('ui.save'), class: 'btn'
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
!!!
|
||||
%html
|
||||
%head
|
||||
%meta{"http-equiv" => "content-type", :content => "text/html;charset=UTF-8"}
|
||||
%title= t '.title', title: (yield(:title) or controller.controller_name)
|
||||
= stylesheet_link_tag 'application'
|
||||
= stylesheet_link_tag "print", :media => "print"
|
||||
<!--[if lte IE 7]>
|
||||
= stylesheet_link_tag 'ie_hacks'
|
||||
<![endif]-->
|
||||
= javascript_include_tag 'application'
|
||||
= csrf_meta_tags
|
||||
= yield(:head)
|
||||
%body
|
||||
#logininfo= render :partial => 'shared/loginInfo'
|
||||
|
||||
#header
|
||||
#logo
|
||||
= link_to root_path do
|
||||
= t('layouts.logo').html_safe
|
||||
%span{:style => "color:white; font-size:45%; letter-spacing: -1px;"}= FoodsoftConfig[:name]
|
||||
#nav= render :partial => 'layouts/main_tabnav'
|
||||
|
||||
#main
|
||||
#content
|
||||
- flash.each do |name, msg|
|
||||
= content_tag :h3, msg, :id => "flash#{name.to_s.camelize}", :class => "flash #{name}"
|
||||
#loader{:style => "display:none;"}= image_tag("loader.gif", :border => 0)
|
||||
- if show_title?
|
||||
%h1= yield(:title)
|
||||
= yield
|
||||
#ajax_box(style="display:none")
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
- title t('.title')
|
||||
= t('.body').html_safe
|
||||
= simple_form_for User.new, url: {action: 'reset_password'} do |form|
|
||||
= simple_form_for User.new, url: reset_password_path do |form|
|
||||
= form.input :email
|
||||
.form-actions
|
||||
= form.submit t('.submit'), class: 'btn'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
- title t('.title')
|
||||
= raw t('.body', user: h(show_user(@user)))
|
||||
= simple_form_for @user, :url => {:action => 'update_password', :id => @user.id, :token => @user.reset_password_token} do |form|
|
||||
= simple_form_for @user, :url => update_password_path(@user.id, :token => @user.reset_password_token) do |form|
|
||||
= form.input :password
|
||||
= form.input :password_confirmation
|
||||
.form-actions
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@
|
|||
%li= order_pdf(@order, :articles, t('.download.article_pdf'))
|
||||
%li= order_pdf(@order, :matrix, t('.download.matrix_pdf'))
|
||||
%li= order_pdf(@order, :fax, t('.download.fax_pdf'))
|
||||
%li= link_to t('.download.fax_txt'), {action: 'text_fax_template', id: @order }, {title: t('.download.download_file')}
|
||||
%li= link_to t('.download.fax_txt'), order_path(@order, format: :txt), {title: t('.download.download_file')}
|
||||
|
||||
%section#articles_table
|
||||
= render 'articles', order: @order
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
- content = wikified_body @page.body, @page.title
|
||||
- toc = generate_toc @page.body
|
||||
|
||||
- unless toc.blank? or params[:preview]
|
||||
- content_for :sidebar do
|
||||
#wikitoc.well.well-small
|
||||
%h3= t '.title_toc'
|
||||
= toc
|
||||
= content
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
- if params[:preview]
|
||||
%section#wikiContent
|
||||
= render 'body'
|
||||
|
||||
.row-fluid
|
||||
.span8
|
||||
= simple_form_for @page do |f|
|
||||
= f.hidden_field :lock_version
|
||||
= f.input :title, input_html: {class: 'input-xxlarge'}
|
||||
= f.input :body, input_html: {class: 'input-xxlarge'}
|
||||
= f.input :parent_id, as: :select, collection: parent_pages_to_select(@page)
|
||||
.form-actions
|
||||
= button_tag :name => 'preview', class: 'btn' do
|
||||
%i.icon-search= t '.preview'
|
||||
= button_tag class: 'btn' do
|
||||
%i.icon-save= t 'ui.save'
|
||||
= link_to t('ui.or_cancel'), @page
|
||||
|
||||
.span4
|
||||
%h3= t '.help.title'
|
||||
%table.table
|
||||
%tbody
|
||||
%tr
|
||||
%td(colspan=2)
|
||||
%b= t '.help.section_character'
|
||||
%tr
|
||||
%td
|
||||
%i= t '.help.italic'
|
||||
%td
|
||||
%pre
|
||||
''#{t '.help.italic'}''<br />
|
||||
%tr
|
||||
%td
|
||||
%b= t '.help.bold'
|
||||
%td
|
||||
%pre '''#{t '.help.bold'}'''<br />
|
||||
%tr
|
||||
%td= t '.help.noformat'
|
||||
%td
|
||||
%pre <nowiki>#{t '.help.text'}</nowiki>
|
||||
%tr
|
||||
%td(colspan=2)
|
||||
%b= t '.help.section_block'
|
||||
%tr
|
||||
%td= t '.help.headings'
|
||||
%td
|
||||
%pre
|
||||
\== #{t '.help.heading', level: 1} ==
|
||||
%pre
|
||||
\=== #{t '.help.heading', level: 2} ===
|
||||
%pre
|
||||
\==== #{t '.help.heading', level: 3} ====
|
||||
%tr
|
||||
%td= t '.help.unordered_list'
|
||||
%td
|
||||
%pre
|
||||
* #{t '.help.list_item_1'}
|
||||
%pre
|
||||
** #{t '.help.list_item_2'}
|
||||
%tr
|
||||
%td= t '.help.ordered_list'
|
||||
%td
|
||||
%pre
|
||||
\# #{t '.help.list_item_1'}
|
||||
%pre
|
||||
\# #{t '.help.list_item_2'}
|
||||
%tr
|
||||
%td(colspan=2)
|
||||
%b= t '.help.section_link'
|
||||
%tr
|
||||
%td= t '.help.wiki_links'
|
||||
%td
|
||||
%pre
|
||||
[[#{t '.help.wiki_link_ex'}]]
|
||||
%tr
|
||||
%td= t '.help.external_links'
|
||||
%td
|
||||
%pre
|
||||
[http://example.net #{t '.help.external_link_ex'}]
|
||||
%tr
|
||||
%td(colspan=2)
|
||||
%b= t '.help.section_table'
|
||||
%tr
|
||||
%td!= t '.help.see_tables', tables_link: link_to(t('.help.tables_link'), "http://www.mediawiki.org/wiki/Help:Tables", :target => '_blank')
|
||||
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
-ident = 20 * level
|
||||
%tr
|
||||
%td{:style => "padding-left: #{ident}px"}
|
||||
= link_to page.title, wiki_page_path(page.permalink)
|
||||
%td #{show_user page.user} (#{format_datetime_timespec(page.updated_at, t('.date_format'))})
|
||||
-if siteMap == 1
|
||||
-for child in page.children.all
|
||||
= render :partial => 'page_list_item', :locals => {:page => child, :level => level+1, :siteMap => 1}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= t 'pages.title'
|
||||
%th= t 'pages.last_updated'
|
||||
%tbody
|
||||
- for page in @pages
|
||||
= render :partial => "page_list_item", :locals => {:page => page, :level => 0, :siteMap => 0}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= t 'pages.title'
|
||||
%th= t 'pages.last_updated'
|
||||
- homepage = Page.find_by_permalink('Home')
|
||||
- unless homepage.nil?
|
||||
= render :partial => 'page_list_item', :locals => {:page => homepage, :level => 0, :siteMap => 1}
|
||||
%tbody
|
||||
- for page in @pages
|
||||
- if page.id != homepage.try(:id)
|
||||
= render :partial => 'page_list_item', :locals => {:page => page, :level => 0, :siteMap => 1}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= t 'pages.title'
|
||||
%th= t 'pages.last_updated'
|
||||
%tbody
|
||||
- for page in @pages
|
||||
= render :partial => "page_list_item", :locals => {:page => page, :level => 0, :siteMap => 0}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
- title t('.title'), false
|
||||
|
||||
- content_for :sidebar do
|
||||
= link_to t('.new_page'), new_page_path, class: 'btn btn-primary'
|
||||
|
||||
.navbar
|
||||
.navbar-inner
|
||||
%ul.nav
|
||||
%li= link_to t('.recent_changes'), all_pages_path(:view => 'recent_changes')
|
||||
%li= link_to t('.title_list'), all_pages_path(:view => 'title_list')
|
||||
%li= link_to t('.site_map'), all_pages_path(:view => 'site_map')
|
||||
= form_tag all_pages_path, method: :get, class: 'form-search pull-right' do
|
||||
= text_field_tag :name, params[:name], class: 'input-medium search-query',
|
||||
placeholder: t('.search.placeholder')
|
||||
= submit_tag t('.search.action'), class: 'btn'
|
||||
|
||||
= render @partial
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
- title t('.title')
|
||||
|
||||
= render 'form'
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
- title t('.title')
|
||||
|
||||
= render 'form'
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
- title @page.title, false
|
||||
|
||||
- content_for :sidebar do
|
||||
%p
|
||||
= link_to edit_page_path(@page), class: 'btn btn-primary' do
|
||||
%i.icon-edit= t '.edit'
|
||||
.well.well-small
|
||||
%ul.nav.nav-list
|
||||
%li
|
||||
%li= link_to t('.versions', count: @page.versions.count), "#versions", 'data-toggle-this' => '#versions'
|
||||
- unless @page.children.empty?
|
||||
%li= link_to t('.subpages'), "#subpages", 'data-toggle-this' => '#subpages'
|
||||
|
||||
#versions.well.well-small{:style => "display:none"}
|
||||
%h3= t '.title_versions'
|
||||
%ul.unstyled
|
||||
- @page.versions.reverse.each do |version|
|
||||
%li
|
||||
= link_to I18n.l(version.updated_at, :format => t('.date_format')), version_page_path(@page, :version => version.lock_version)
|
||||
= "(#{show_user(User.find_by_id(version.updated_by))})"
|
||||
|
||||
- unless @page.children.empty?
|
||||
#subpages.well.well-small{:style => "display:none"}
|
||||
%h3= t '.subpages'
|
||||
%ul.unstyled
|
||||
- @page.children.each do |page|
|
||||
%li= link_to_wikipage(page)
|
||||
|
||||
%ul.breadcrumb
|
||||
%li
|
||||
= link_to_wikipage_by_permalink("Home", "Foodcoop-Wiki")
|
||||
%span.divider /
|
||||
- for page in @page.ancestors.reverse
|
||||
%li
|
||||
= link_to_wikipage(page)
|
||||
%span.divider /
|
||||
%li.active= @page.title
|
||||
|
||||
|
||||
#wikiContent
|
||||
.page-header
|
||||
%h1= @page.title
|
||||
= render :partial => 'body'
|
||||
|
||||
%hr.clear/
|
||||
%p
|
||||
= link_to edit_page_path(@page), class: 'btn btn-primary' do
|
||||
%i.icon-edit= t '.edit'
|
||||
= link_to t('.delete'), @page, class: 'btn btn-danger', :method => :delete,
|
||||
:confirm => t('.delete_confirm')
|
||||
!= '| ' + t('.last_updated', user: show_user(@page.user), when: format_datetime(@page.updated_at))
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
- title t('.title', title: @page.title, version: @version.lock_version)
|
||||
|
||||
- content_for :sidebar do
|
||||
%h3= t '.title_version'
|
||||
%b= "#{format_datetime_timespec(@version.updated_at, t('.date_format'))}"
|
||||
%ul
|
||||
%li= t '.author', user: show_user(User.find(@version.updated_by))
|
||||
%li= link_to t('.view_current'), wiki_page_path(:permalink => @page.permalink)
|
||||
%li= link_to t('.revert'), revert_page_path(@page, :version => @version.lock_version)
|
||||
|
||||
= wikified_body @version.body
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
%ul.autocomplete
|
||||
- for article in @articles
|
||||
- supplier = @supplier ? "" : " - #{truncate(article.supplier.name)}"
|
||||
%li{:id => article.id.to_s}= "#{article.name} (#{article.unit_quantity} * #{article.unit} | #{number_to_currency(article.price)}#{supplier})"
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<ul class="autocomplete">
|
||||
<% for user in @users do -%>
|
||||
<li><span class="nick"><%= show_user(user) %></span><span class="informal"> (<%= user.ordergroup.try(:name) %>)</span></li>
|
||||
<% end -%>
|
||||
</ul>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
%ul
|
||||
%li
|
||||
= image_tag 'b_user.png' , :size => '7x10', :border => 0, :alt => t('.profile')
|
||||
= link_to h(@current_user.nick), my_profile_path, { :title => t('.edit_profile') }
|
||||
- if FoodsoftConfig[:homepage]
|
||||
%li= link_to FoodsoftConfig[:name], FoodsoftConfig[:homepage], { :title => t('.homepage_title') }
|
||||
%li= link_to t('.help'), FoodsoftConfig[:help_url]
|
||||
%li= link_to t('.feedback.title'), new_feedback_path, :title => t('.feedback.desc')
|
||||
%li= link_to t('.logout'), logout_path
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
<% if flash[:error] %>
|
||||
<h3 class="error" id="flashError" ><%= flash[:error] %></h3>
|
||||
<%= javascript_tag("new Effect.Highlight('flashError', {delay:0.8, duration:1});") -%>
|
||||
<% end %>
|
||||
|
||||
<% memberships = @group.memberships
|
||||
if memberships.size != 0 %>
|
||||
<ul style="">
|
||||
<% for membership in memberships %>
|
||||
<li style="margin-left:-15px">
|
||||
<%= show_user membership.user, full: true, markup: true %>
|
||||
| <%= link_to_remote t('.drop'),
|
||||
:url => { :controller => '/memberships', :action => 'drop_member', :id => @group, :membership_id => membership },
|
||||
:before => "Element.show('loader')",
|
||||
:success => "Element.hide('loader')" %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% else %>
|
||||
<p><i><%= t('.no_members', group: @group.name) %></i></p>
|
||||
<% end %>
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<h1><%=h t('.title', group: @group.name) %></h1>
|
||||
<p>
|
||||
<i><%= t('.desc', link: remote_link_to(t('.invite'), :url => new_invite_path(:id => @group))).html_safe %></i>
|
||||
</p>
|
||||
<div class="left_column" style="width:48%">
|
||||
<div class="box_title">
|
||||
<h2><%= t('.already_members') %></h2>
|
||||
</div>
|
||||
<div class="column_content" id="members">
|
||||
<%=render :partial => 'shared/memberships/current_members' %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right_column" style="width:48%">
|
||||
<div class="box_title">
|
||||
<h2><%= t('.no_members_yet') %></h2>
|
||||
</div>
|
||||
<div class="column_content" id="non_members">
|
||||
<%= render :partial => 'shared/memberships/non_members' %>
|
||||
<%= remote_link_to(t('.invite_someone'), :url => new_invite_path(:id => @group)) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="edit_box" style="display:none"></div>
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<ul>
|
||||
<% for user in @group.non_members %>
|
||||
<li>
|
||||
<%= show_user user, full: true, markup: true %>
|
||||
| <%= link_to_remote t('.add'),
|
||||
:url => { :controller => '/memberships', :action => 'add_member', :id => @group, :user_id => user },
|
||||
:before => "Element.show('loader')",
|
||||
:success => "Element.hide('loader')" %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
|
@ -13,5 +13,5 @@
|
|||
- @tasks.each do |task|
|
||||
%tr
|
||||
%td= task.due_date unless task.due_date.nil?
|
||||
%td= link_to t('.task_format', name: task.name, duration: task.duration), :controller => "tasks", :action => "show", :id => task
|
||||
%td= link_to t('.task_format', name: task.name, duration: task.duration), task_path(task)
|
||||
%td= task_assignments task
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue